| 2889 | } |
| 2890 | |
| 2891 | TSReturnCode |
| 2892 | TSHttpHdrStatusSet(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 | |
| 2913 | const char * |
| 2914 | TSHttpHdrReasonGet(TSMBuffer bufp, TSMLoc obj, int *length) |