| 101 | } |
| 102 | |
| 103 | string |
| 104 | Response::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 | |
| 122 | void |
| 123 | Response::setReasonPhrase(const string &phrase) |
nothing calls this directly
no test coverage detected