| 78 | } |
| 79 | |
| 80 | void |
| 81 | Request::init(void *hdr_buf, void *hdr_loc) |
| 82 | { |
| 83 | reset(); |
| 84 | if (!hdr_buf || !hdr_loc) { |
| 85 | return; |
| 86 | } |
| 87 | state_->hdr_buf_ = static_cast<TSMBuffer>(hdr_buf); |
| 88 | state_->hdr_loc_ = static_cast<TSMLoc>(hdr_loc); |
| 89 | state_->headers_.reset(state_->hdr_buf_, state_->hdr_loc_); |
| 90 | state_->url_loc_ = nullptr; |
| 91 | TSReturnCode ret = TSHttpHdrUrlGet(state_->hdr_buf_, state_->hdr_loc_, &state_->url_loc_); |
| 92 | if (!state_->url_loc_ and ret != TS_SUCCESS) { |
| 93 | LOG_ERROR("TSHttpHdrUrlGet returned a null url loc, hdr_buf=%p, hdr_loc=%p", state_->hdr_buf_, state_->hdr_loc_); |
| 94 | } else { |
| 95 | state_->url_.init(state_->hdr_buf_, state_->url_loc_); |
| 96 | LOG_DEBUG("Initialized url"); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | void |
| 101 | Request::reset() |
no test coverage detected