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

Method write_header_into_buffer

src/proxy/http/HttpSM.cc:6573–6596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6571}
6572
6573int
6574HttpSM::write_header_into_buffer(HTTPHdr *h, MIOBuffer *b)
6575{
6576 int dumpoffset;
6577 int done;
6578
6579 dumpoffset = 0;
6580 do {
6581 IOBufferBlock *block = b->get_current_block();
6582 int bufindex = 0;
6583 int tmp = dumpoffset;
6584
6585 ink_assert(block->write_avail() > 0);
6586 done = h->print(block->start(), block->write_avail(), &bufindex, &tmp);
6587 dumpoffset += bufindex;
6588 ink_assert(bufindex > 0);
6589 b->fill(bufindex);
6590 if (!done) {
6591 b->add_block();
6592 }
6593 } while (!done);
6594
6595 return dumpoffset;
6596}
6597
6598void
6599HttpSM::attach_server_session()

Callers

nothing calls this directly

Calls 6

get_current_blockMethod · 0.80
write_availMethod · 0.45
printMethod · 0.45
startMethod · 0.45
fillMethod · 0.45
add_blockMethod · 0.45

Tested by

no test coverage detected