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

Function TSHttpHdrPrint

src/api/InkAPI.cc:2604–2637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2602}
2603
2604void
2605TSHttpHdrPrint(TSMBuffer bufp, TSMLoc obj, TSIOBuffer iobufp)
2606{
2607 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
2608 sdk_assert(sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS);
2609 sdk_assert(sdk_sanity_check_iocore_structure(iobufp) == TS_SUCCESS);
2610
2611 MIOBuffer *b = reinterpret_cast<MIOBuffer *>(iobufp);
2612 IOBufferBlock *blk;
2613 HTTPHdr h;
2614 int bufindex;
2615 int tmp, dumpoffset;
2616 int done;
2617
2618 SET_HTTP_HDR(h, bufp, obj);
2619 ink_assert(h.m_http->m_type == HDR_HEAP_OBJ_HTTP_HEADER);
2620
2621 dumpoffset = 0;
2622 do {
2623 blk = b->get_current_block();
2624 if (!blk || blk->write_avail() == 0) {
2625 b->add_block();
2626 blk = b->get_current_block();
2627 }
2628
2629 bufindex = 0;
2630 tmp = dumpoffset;
2631
2632 done = h.print(blk->end(), blk->write_avail(), &bufindex, &tmp);
2633
2634 dumpoffset += bufindex;
2635 b->fill(bufindex);
2636 } while (!done);
2637}
2638
2639TSParseResult
2640TSHttpHdrParseReq(TSHttpParser parser, TSMBuffer bufp, TSMLoc obj, const char **start, const char *end)

Callers 15

GeneratorWriteResponseFunction · 0.85
GeneratorPOSTResponseFunction · 0.85
handleFirstServerHeaderFunction · 0.85
toStringMethod · 0.85
request_blockFunction · 0.85
fetchMethod · 0.85
print_headersFunction · 0.85
RequestMethod · 0.85
headerMethod · 0.85

Calls 9

sdk_sanity_check_mbufferFunction · 0.85
get_current_blockMethod · 0.80
write_availMethod · 0.45
add_blockMethod · 0.45
printMethod · 0.45
endMethod · 0.45
fillMethod · 0.45

Tested by 2