MCPcopy Create free account
hub / github.com/apache/trafficserver / setHost

Method setHost

src/tscpp/api/Url.cc:201–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void
202Url::setHost(const std::string &host)
203{
204 if (!isInitialized()) {
205 LOG_ERROR("Url %p not initialized", this);
206 return;
207 }
208
209 if (TSUrlHostSet(state_->hdr_buf_, state_->url_loc_, host.c_str(), host.length()) == TS_SUCCESS) {
210 LOG_DEBUG("Set host to [%s]", host.c_str());
211 } else {
212 LOG_ERROR("Could not set host; hdr_buf %p, url_loc %p", state_->hdr_buf_, state_->url_loc_);
213 }
214}
215
216void
217Url::setPort(const uint16_t port)

Callers

nothing calls this directly

Calls 3

TSUrlHostSetFunction · 0.85
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected