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

Method parse

plugins/multiplexer/fetcher.cc:37–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37bool
38HttpParser::parse(io::IO &io)
39{
40 using multiplexer_ns::dbg_ctl;
41 if (parsed_) {
42 return true;
43 }
44 TSIOBufferBlock block = TSIOBufferReaderStart(io.reader);
45 while (block != nullptr) {
46 int64_t size = 0;
47 const char *const begin = TSIOBufferBlockReadStart(block, io.reader, &size);
48 const char *iterator = begin;
49
50 parsed_ = (TSHttpHdrParseResp(parser_, buffer_, location_, &iterator, iterator + size) == TS_PARSE_DONE);
51 TSIOBufferReaderConsume(io.reader, iterator - begin);
52
53 if (parsed_) {
54 Dbg(dbg_ctl, "HttpParser: response parsing is complete (%u response status code)", statusCode());
55 assert(parser_ != nullptr);
56 destroyParser();
57 return true;
58 }
59
60 block = TSIOBufferBlockNext(block);
61 }
62 return false;
63}
64
65} // namespace ats

Callers 1

handleMethod · 0.45

Calls 5

TSHttpHdrParseRespFunction · 0.85
TSIOBufferReaderStartFunction · 0.50
TSIOBufferBlockReadStartFunction · 0.50
TSIOBufferReaderConsumeFunction · 0.50
TSIOBufferBlockNextFunction · 0.50

Tested by

no test coverage detected