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

Method pack

plugins/esi/common/DocNode.cc:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void
64DocNode::pack(string &buffer) const
65{
66 int32_t orig_buf_size = buffer.size();
67 buffer += DOCNODE_VERSION;
68 buffer.append(sizeof(int32_t), ' '); // reserve space for length
69 buffer.append(reinterpret_cast<const char *>(&type), sizeof(type));
70 packString(data, data_len, buffer);
71 int32_t n_elements = attr_list.size();
72 buffer.append(reinterpret_cast<const char *>(&n_elements), sizeof(n_elements));
73 for (const auto &iter : attr_list) {
74 packString(iter.name, iter.name_len, buffer);
75 packString(iter.value, iter.value_len, buffer);
76 }
77 child_nodes.packToBuffer(buffer);
78 *(reinterpret_cast<int32_t *>(&buffer[orig_buf_size + 1])) = buffer.size() - orig_buf_size;
79}
80
81bool
82DocNode::unpack(const char *packed_data, int packed_data_len, int &node_len)

Callers 8

src_addrMethod · 0.45
dst_addrMethod · 0.45
LLVMFuzzerTestOneInputFunction · 0.45
packNodeListMethod · 0.45
docnode_test.ccFile · 0.45
processor_test.ccFile · 0.45
packToBufferMethod · 0.45

Calls 4

packStringFunction · 0.85
packToBufferMethod · 0.80
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected