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

Method setUrl

plugins/slice/HttpHeader.cc:77–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77bool
78HttpHeader::setUrl(TSMBuffer const bufurl, TSMLoc const locurl)
79{
80 if (!isValid()) {
81 return false;
82 }
83
84 TSMLoc locurlout = nullptr;
85 TSReturnCode rcode = TSHttpHdrUrlGet(m_buffer, m_lochdr, &locurlout);
86 if (TS_SUCCESS != rcode) {
87 return false;
88 }
89
90 // copy the url
91 rcode = TSUrlCopy(m_buffer, locurlout, bufurl, locurl);
92
93 // set url active
94 if (TS_SUCCESS == rcode) {
95 rcode = TSHttpHdrUrlSet(m_buffer, m_lochdr, locurlout);
96 }
97
98 TSHandleMLocRelease(m_buffer, m_lochdr, locurlout);
99
100 return TS_SUCCESS == rcode;
101}
102
103bool
104HttpHeader::setReason(char const *const valstr, int const vallen)

Callers 1

handle_client_reqFunction · 0.80

Calls 4

TSHttpHdrUrlGetFunction · 0.85
TSUrlCopyFunction · 0.85
TSHttpHdrUrlSetFunction · 0.85
TSHandleMLocReleaseFunction · 0.85

Tested by

no test coverage detected