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

Method write

src/proxy/hdrs/XPACK.cc:562–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562uint32_t
563XpackDynamicTableStorage::write(const char *name, uint32_t name_len, const char *value, uint32_t value_len)
564{
565 // insert_entry should guard against buffer overrun, but rather than overrun
566 // our buffer we assert here in case something horrible went wrong.
567 ink_release_assert(name_len + value_len <= this->_capacity);
568 ink_release_assert(this->_head == this->_capacity - 1 || this->_head + name_len + value_len <= this->_capacity);
569
570 uint32_t offset = (this->_head + 1) % this->_capacity;
571 if (name_len > 0) {
572 memcpy(this->_data + offset, name, name_len);
573 }
574 if (value_len > 0) {
575 memcpy(this->_data + offset + name_len, value, value_len);
576 }
577
578 this->_head = (this->_head + (name_len + value_len)) % this->_capacity;
579 if (this->_head > this->_overwrite_threshold) {
580 // This is how we wrap back around to the beginning of the buffer.
581 this->_head = this->_capacity - 1;
582 }
583
584 return offset;
585}
586
587bool
588XpackDynamicTableStorage::_start_expanding_capacity(uint32_t new_maximum_size)

Callers 15

fancy_chain_printFunction · 0.45
parse_records_fileFunction · 0.45
_do_http_requestMethod · 0.45
main_event_handlerMethod · 0.45
RecYAMLDecoder.ccFile · 0.45
config_setMethod · 0.45
transfer_bytesMethod · 0.45
process_fetch_readMethod · 0.45
ext_initMethod · 0.45
ext_add_headerMethod · 0.45
ext_launchMethod · 0.45

Calls 1

memcpyFunction · 0.50

Tested by 11

client_handlerFunction · 0.36
create_pushfileFunction · 0.36
replay_proxy_responseFunction · 0.36
update_remap_configFunction · 0.36
MakeGoldFileWithTextFunction · 0.36
data_fileFunction · 0.36
__setupClientMethod · 0.36
makeTestCaseFunction · 0.36
_writeMethod · 0.36
buildMetaTestFunction · 0.36