| 2758 | } |
| 2759 | |
| 2760 | TSReturnCode |
| 2761 | TSHttpHdrVersionSet(TSMBuffer bufp, TSMLoc obj, int ver) |
| 2762 | { |
| 2763 | // Allow to modify the buffer only |
| 2764 | // if bufp is modifiable. If bufp is not modifiable return |
| 2765 | // TS_ERROR. If allowed, return TS_SUCCESS. Changed the |
| 2766 | // return value of function from void to TSReturnCode. |
| 2767 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 2768 | sdk_assert(sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS); |
| 2769 | |
| 2770 | if (!isWriteable(bufp)) { |
| 2771 | return TS_ERROR; |
| 2772 | } |
| 2773 | |
| 2774 | HTTPHdr h; |
| 2775 | HTTPVersion version{ver}; |
| 2776 | |
| 2777 | SET_HTTP_HDR(h, bufp, obj); |
| 2778 | ink_assert(h.m_http->m_type == HDR_HEAP_OBJ_HTTP_HEADER); |
| 2779 | |
| 2780 | h.version_set(version); |
| 2781 | return TS_SUCCESS; |
| 2782 | } |
| 2783 | |
| 2784 | const char * |
| 2785 | TSHttpHdrMethodGet(TSMBuffer bufp, TSMLoc obj, int *length) |