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

Method init

src/tscpp/api/Request.cc:80–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void
81Request::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
100void
101Request::reset()

Callers 1

RequestMethod · 0.45

Calls 2

TSHttpHdrUrlGetFunction · 0.85
resetMethod · 0.45

Tested by

no test coverage detected