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

Function TSHttpHdrReasonSet

src/api/InkAPI.cc:2926–2953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2924}
2925
2926TSReturnCode
2927TSHttpHdrReasonSet(TSMBuffer bufp, TSMLoc obj, const char *value, int length)
2928{
2929 // Allow to modify the buffer only
2930 // if bufp is modifiable. If bufp is not modifiable return
2931 // TS_ERROR. If allowed, return TS_SUCCESS. Changed the
2932 // return value of function from void to TSReturnCode.
2933 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
2934 sdk_assert(sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS);
2935 sdk_assert(sdk_sanity_check_null_ptr((void *)value) == TS_SUCCESS);
2936
2937 if (!isWriteable(bufp)) {
2938 return TS_ERROR;
2939 }
2940
2941 HTTPHdr h;
2942
2943 SET_HTTP_HDR(h, bufp, obj);
2944 /* Don't need the assert as the check is done in sdk_sanity_check_http_hdr_handle
2945 ink_assert(h.m_http->m_type == HDR_HEAP_OBJ_HTTP_HEADER);
2946 */
2947
2948 if (length < 0) {
2949 length = strlen(value);
2950 }
2951 h.reason_set(value, length);
2952 return TS_SUCCESS;
2953}
2954
2955const char *
2956TSHttpHdrReasonLookup(TSHttpStatus status)

Callers 15

handle_responseFunction · 0.85
handle_responseFunction · 0.85
handle_responseFunction · 0.85
handle_responseFunction · 0.85
Headers.ccFile · 0.85
setReasonPhraseMethod · 0.85
WriteResponseHeaderFunction · 0.85
setReasonMethod · 0.85
on_send_response_headerFunction · 0.85
WriteResponseHeaderFunction · 0.85
execMethod · 0.85

Calls 5

sdk_sanity_check_mbufferFunction · 0.85
isWriteableFunction · 0.85
reason_setMethod · 0.45

Tested by 1