| 2850 | } |
| 2851 | |
| 2852 | TSReturnCode |
| 2853 | TSHttpHdrUrlSet(TSMBuffer bufp, TSMLoc obj, TSMLoc url) |
| 2854 | { |
| 2855 | // Allow to modify the buffer only |
| 2856 | // if bufp is modifiable. If bufp is not modifiable return |
| 2857 | // TS_ERROR. If allowed, return TS_SUCCESS. Changed the |
| 2858 | // return value of function from void to TSReturnCode. |
| 2859 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 2860 | sdk_assert(sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS); |
| 2861 | sdk_assert(sdk_sanity_check_url_handle(url) == TS_SUCCESS); |
| 2862 | |
| 2863 | if (!isWriteable(bufp)) { |
| 2864 | return TS_ERROR; |
| 2865 | } |
| 2866 | |
| 2867 | HdrHeap *heap = (reinterpret_cast<HdrHeapSDKHandle *>(bufp))->m_heap; |
| 2868 | HTTPHdrImpl *hh = reinterpret_cast<HTTPHdrImpl *>(obj); |
| 2869 | |
| 2870 | if (hh->m_type != HDR_HEAP_OBJ_HTTP_HEADER) { |
| 2871 | return TS_ERROR; |
| 2872 | } |
| 2873 | |
| 2874 | URLImpl *url_impl = reinterpret_cast<URLImpl *>(url); |
| 2875 | http_hdr_url_set(heap, hh, url_impl); |
| 2876 | return TS_SUCCESS; |
| 2877 | } |
| 2878 | |
| 2879 | TSHttpStatus |
| 2880 | TSHttpHdrStatusGet(TSMBuffer bufp, TSMLoc obj) |