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

Function TSHttpHdrVersionSet

src/api/InkAPI.cc:2760–2782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2758}
2759
2760TSReturnCode
2761TSHttpHdrVersionSet(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
2784const char *
2785TSHttpHdrMethodGet(TSMBuffer bufp, TSMLoc obj, int *length)

Calls 4

sdk_sanity_check_mbufferFunction · 0.85
isWriteableFunction · 0.85
version_setMethod · 0.80

Tested by 1