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

Function TSHttpHdrMethodSet

src/api/InkAPI.cc:2797–2821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2795}
2796
2797TSReturnCode
2798TSHttpHdrMethodSet(TSMBuffer bufp, TSMLoc obj, const char *value, int length)
2799{
2800 // Allow to modify the buffer only
2801 // if bufp is modifiable. If bufp is not modifiable return
2802 // TS_ERROR. If allowed, return TS_SUCCESS. Changed the
2803 // return value of function from void to TSReturnCode.
2804 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
2805 sdk_assert(sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS);
2806 sdk_assert(sdk_sanity_check_null_ptr((void *)value) == TS_SUCCESS);
2807
2808 if (!isWriteable(bufp)) {
2809 return TS_ERROR;
2810 }
2811
2812 HTTPHdr h;
2813
2814 SET_HTTP_HDR(h, bufp, obj);
2815 if (length < 0) {
2816 length = strlen(value);
2817 }
2818
2819 h.method_set(value, length);
2820 return TS_SUCCESS;
2821}
2822
2823const char *
2824TSHttpHdrHostGet(TSMBuffer bufp, TSMLoc obj, int *length)

Callers 6

AuthWriteHeadRequestFunction · 0.85
AuthWriteRangeRequestFunction · 0.85
setPropertyMethod · 0.85

Calls 5

sdk_sanity_check_mbufferFunction · 0.85
isWriteableFunction · 0.85
method_setMethod · 0.80

Tested by 1