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

Method marshal

src/iocore/cache/CacheHttp.cc:180–200  ·  view source on GitHub ↗

------------------------------------------------------------------------- -------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

178/*-------------------------------------------------------------------------
179 -------------------------------------------------------------------------*/
180int
181CacheHTTPInfoVector::marshal(char *buf, int length)
182{
183 char *start = buf;
184 int count = 0;
185
186 ink_assert(!(((intptr_t)buf) & 3)); // buf must be aligned
187
188 for (int i = 0; i < xcount; i++) {
189 int tmp = data[i].alternate.marshal(buf, length);
190 length -= tmp;
191 buf += tmp;
192 count++;
193 }
194
195 ts::Metrics::Counter::increment(cache_rsb.hdr_vector_marshal);
196 ts::Metrics::Counter::increment(cache_rsb.hdr_marshal, count);
197 ts::Metrics::Counter::increment(cache_rsb.hdr_marshal_bytes, buf - start);
198
199 return buf - start;
200}
201
202int
203CacheHTTPInfoVector::unmarshal(const char *buf, int length, RefCountObj *block_ptr)

Callers 1

update_header_infoFunction · 0.45

Calls 1

incrementFunction · 0.85

Tested by

no test coverage detected