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

Function TSMimeHdrFieldValueIntInsert

src/api/InkAPI.cc:2381–2400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2379}
2380
2381TSReturnCode
2382TSMimeHdrFieldValueIntInsert(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int value)
2383{
2384 // Allow to modify the buffer only
2385 // if bufp is modifiable. If bufp is not modifiable return
2386 // TS_ERROR, else return TS_SUCCESS.
2387 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
2388 sdk_assert((sdk_sanity_check_mime_hdr_handle(hdr) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(hdr) == TS_SUCCESS));
2389 sdk_assert(sdk_sanity_check_field_handle(field, hdr) == TS_SUCCESS);
2390
2391 if (!isWriteable(bufp)) {
2392 return TS_ERROR;
2393 }
2394
2395 char tmp[16];
2396 int len = mime_format_int(tmp, value, sizeof(tmp));
2397
2398 TSMimeFieldValueInsert(bufp, field, tmp, len, idx);
2399 return TS_SUCCESS;
2400}
2401
2402TSReturnCode
2403TSMimeHdrFieldValueUintInsert(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, unsigned int value)

Calls 7

sdk_sanity_check_mbufferFunction · 0.85
isWriteableFunction · 0.85
mime_format_intFunction · 0.85
TSMimeFieldValueInsertFunction · 0.85

Tested by 1