| 1324 | } |
| 1325 | |
| 1326 | int |
| 1327 | QPACK::_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 | |
| 1361 | int |
| 1362 | QPACK::_write_duplicate(uint16_t index) |
no test coverage detected