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

Method getReasonPhrase

src/tscpp/api/Response.cc:103–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103string
104Response::getReasonPhrase() const
105{
106 string ret_str;
107 if (state_->hdr_buf_ && state_->hdr_loc_) {
108 int length;
109 const char *str = TSHttpHdrReasonGet(state_->hdr_buf_, state_->hdr_loc_, &length);
110 if (str && length) {
111 ret_str.assign(str, length);
112 LOG_DEBUG("Initializing response reason phrase to '%s' with hdr_buf=%p and hdr_loc=%p", ret_str.c_str(), state_->hdr_buf_,
113 state_->hdr_loc_);
114 } else {
115 LOG_ERROR("TSHttpHdrReasonGet returned null string or zero length. str=%p, length=%d, hdr_buf=%p, hdr_loc=%p", str, length,
116 state_->hdr_buf_, state_->hdr_loc_);
117 }
118 }
119 return ret_str; // if not initialized, we will just return an empty string
120}
121
122void
123Response::setReasonPhrase(const string &phrase)

Callers

nothing calls this directly

Calls 3

TSHttpHdrReasonGetFunction · 0.85
assignMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected