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

Function TSMimeHdrFieldValueStringInsert

src/api/InkAPI.cc:2359–2379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2357}
2358
2359TSReturnCode
2360TSMimeHdrFieldValueStringInsert(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char *value, int length)
2361{
2362 // Allow to modify the buffer only
2363 // if bufp is modifiable. If bufp is not modifiable return
2364 // TS_ERROR, else return TS_SUCCESS.
2365 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
2366 sdk_assert((sdk_sanity_check_mime_hdr_handle(hdr) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(hdr) == TS_SUCCESS));
2367 sdk_assert(sdk_sanity_check_field_handle(field, hdr) == TS_SUCCESS);
2368 sdk_assert(sdk_sanity_check_null_ptr((void *)value) == TS_SUCCESS);
2369
2370 if (!isWriteable(bufp)) {
2371 return TS_ERROR;
2372 }
2373
2374 if (length == -1) {
2375 length = strlen(value);
2376 }
2377 TSMimeFieldValueInsert(bufp, field, value, length, idx);
2378 return TS_SUCCESS;
2379}
2380
2381TSReturnCode
2382TSMimeHdrFieldValueIntInsert(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int value)

Callers 15

handle_responseFunction · 0.85
handle_responseFunction · 0.85
replace_headerFunction · 0.85
TSRemapDoRemapFunction · 0.85
modify_headerFunction · 0.85
TSPluginInitFunction · 0.85
TSPluginInitFunction · 0.85
appendMethod · 0.85
txn_handlerFunction · 0.85
addMimeHeaderFieldFunction · 0.85
InjectCacheKeyHeaderFunction · 0.85

Calls 7

sdk_sanity_check_mbufferFunction · 0.85
isWriteableFunction · 0.85
TSMimeFieldValueInsertFunction · 0.85

Tested by 1