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

Function TSHttpHdrStatusSet

src/api/InkAPI.cc:2891–2911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2889}
2890
2891TSReturnCode
2892TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc obj, TSHttpStatus status)
2893{
2894 // Allow to modify the buffer only
2895 // if bufp is modifiable. If bufp is not modifiable return
2896 // TS_ERROR. If allowed, return TS_SUCCESS. Changed the
2897 // return value of function from void to TSReturnCode.
2898 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
2899 sdk_assert(sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS);
2900
2901 if (!isWriteable(bufp)) {
2902 return TS_ERROR;
2903 }
2904
2905 HTTPHdr h;
2906
2907 SET_HTTP_HDR(h, bufp, obj);
2908 ink_assert(h.m_http->m_type == HDR_HEAP_OBJ_HTTP_HEADER);
2909 h.status_set(static_cast<HTTPStatus>(status));
2910 return TS_SUCCESS;
2911}
2912
2913const char *
2914TSHttpHdrReasonGet(TSMBuffer bufp, TSMLoc obj, int *length)

Callers 15

handle_responseFunction · 0.85
handle_responseFunction · 0.85
handle_responseFunction · 0.85
handle_responseFunction · 0.85
Headers.ccFile · 0.85
setStatusCodeMethod · 0.85
WriteResponseHeaderFunction · 0.85
setStatusMethod · 0.85
on_send_response_headerFunction · 0.85
WriteResponseHeaderFunction · 0.85
execMethod · 0.85

Calls 4

sdk_sanity_check_mbufferFunction · 0.85
isWriteableFunction · 0.85
status_setMethod · 0.45

Tested by 1