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

Method _write_insert_without_name_ref

src/proxy/http3/QPACK.cc:1326–1359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1324}
1325
1326int
1327QPACK::_write_insert_without_name_ref(const char *name, int name_len, const char *value, uint16_t value_len)
1328{
1329 IOBufferBlock *instruction = new_IOBufferBlock();
1330 instruction->alloc(TS_IOBUFFER_SIZE_INDEX_2K);
1331
1332 char *buf = instruction->end();
1333 char *buf_end = buf + instruction->write_avail();
1334 int written = 0;
1335
1336 // Insert Without Name Reference
1337 buf[0] = 0x40;
1338
1339 // Name
1340 int ret;
1341 if ((ret = xpack_encode_string(reinterpret_cast<uint8_t *>(buf + written), reinterpret_cast<uint8_t *>(buf_end), name, name_len,
1342 5)) < 0) {
1343 return ret;
1344 }
1345 written += ret;
1346
1347 // Value
1348 if ((ret = xpack_encode_string(reinterpret_cast<uint8_t *>(buf + written), reinterpret_cast<uint8_t *>(buf_end), value, value_len,
1349 7)) < 0) {
1350 return ret;
1351 }
1352 written += ret;
1353
1354 // Finalize and Schedule to send
1355 instruction->fill(written);
1356 this->_encoder_stream_sending_instructions->append_block(instruction);
1357
1358 return 0;
1359}
1360
1361int
1362QPACK::_write_duplicate(uint16_t index)

Callers 1

_encode_headerMethod · 0.95

Calls 6

xpack_encode_stringFunction · 0.85
allocMethod · 0.45
endMethod · 0.45
write_availMethod · 0.45
fillMethod · 0.45
append_blockMethod · 0.45

Tested by

no test coverage detected