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

Function TSMimeHdrPrint

src/api/InkAPI.cc:1520–1547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1518}
1519
1520void
1521TSMimeHdrPrint(TSMLoc obj, TSIOBuffer iobufp)
1522{
1523 sdk_assert((sdk_sanity_check_mime_hdr_handle(obj) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS));
1524 sdk_assert(sdk_sanity_check_iocore_structure(iobufp) == TS_SUCCESS);
1525
1526 MIMEHdrImpl const *mh = _hdr_mloc_to_mime_hdr_impl(obj);
1527 MIOBuffer *b = reinterpret_cast<MIOBuffer *>(iobufp);
1528 IOBufferBlock *blk;
1529 int bufindex;
1530 int tmp, dumpoffset = 0;
1531 int done;
1532
1533 do {
1534 blk = b->get_current_block();
1535 if (!blk || blk->write_avail() == 0) {
1536 b->add_block();
1537 blk = b->get_current_block();
1538 }
1539
1540 bufindex = 0;
1541 tmp = dumpoffset;
1542 done = mime_hdr_print(mh, blk->end(), blk->write_avail(), &bufindex, &tmp);
1543
1544 dumpoffset += bufindex;
1545 b->fill(bufindex);
1546 } while (!done);
1547}
1548
1549TSParseResult
1550TSMimeHdrParse(TSMimeParser parser, TSMBuffer bufp, TSMLoc obj, const char **start, const char *end)

Callers 8

handle_dnsFunction · 0.85
handle_scanFunction · 0.85
dumpHeadersFunction · 0.85
dump_headersFunction · 0.85
dump_headersFunction · 0.85

Calls 10

mime_hdr_printFunction · 0.85
get_current_blockMethod · 0.80
write_availMethod · 0.45
add_blockMethod · 0.45
endMethod · 0.45
fillMethod · 0.45

Tested by 1