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

Method parse_req

src/proxy/hdrs/HdrTSOnly.cc:46–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 -------------------------------------------------------------------------*/
45
46ParseResult
47HTTPHdr::parse_req(HTTPParser *parser, IOBufferReader *r, int *bytes_used, bool eof, int strict_uri_parsing,
48 size_t max_request_line_size, size_t max_hdr_field_size)
49{
50 const char *start;
51 const char *tmp;
52 const char *end;
53 int used;
54
55 ink_assert(valid());
56 ink_assert(m_http->m_polarity == HTTP_TYPE_REQUEST);
57
58 ParseResult state = PARSE_RESULT_CONT;
59 *bytes_used = 0;
60
61 do {
62 int64_t b_avail = r->block_read_avail();
63
64 if (b_avail <= 0 && eof == false) {
65 break;
66 }
67
68 tmp = start = r->start();
69 end = start + b_avail;
70
71 int heap_slot = m_heap->attach_block(r->get_current_block(), start);
72
73 m_heap->lock_ronly_str_heap(heap_slot);
74 state = http_parser_parse_req(parser, m_heap, m_http, &tmp, end, false, eof, strict_uri_parsing, max_request_line_size,
75 max_hdr_field_size);
76 m_heap->set_ronly_str_heap_end(heap_slot, tmp);
77 m_heap->unlock_ronly_str_heap(heap_slot);
78
79 used = static_cast<int>(tmp - start);
80 r->consume(used);
81 *bytes_used += used;
82
83 } while (state == PARSE_RESULT_CONT);
84
85 return state;
86}
87
88ParseResult
89HTTPHdr::parse_resp(HTTPParser *parser, IOBufferReader *r, int *bytes_used, bool eof)

Callers 13

build_hdrsFunction · 0.45
request_to_dataFunction · 0.45
setup_client_requestFunction · 0.45
update_write_requestMethod · 0.45
test_HTTP2.ccFile · 0.45
test_Hdrs.ccFile · 0.45
test_http_hdr_null_charFunction · 0.45
test_http_hdr_ctl_charFunction · 0.45

Calls 9

http_parser_parse_reqFunction · 0.85
block_read_availMethod · 0.80
attach_blockMethod · 0.80
get_current_blockMethod · 0.80
lock_ronly_str_heapMethod · 0.80
unlock_ronly_str_heapMethod · 0.80
startMethod · 0.45
consumeMethod · 0.45

Tested by 4

test_http_hdr_null_charFunction · 0.36
test_http_hdr_ctl_charFunction · 0.36