TSHTTPTXNCLIENTREQGET(3ts)
π TSHTTPTXNCLIENTREQGET π
okay bestie, so this is a page from the Apache Traffic Server manual, section 3ts (that's the library-functions corner of the manual, iykyk). Sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
TSHttpTxnClientReqGet β the API function that goes and gets you the client request. That's it, that's the whole job. π
πΈ SYNOPSIS πΈ
#include <ts/ts.h>
TSReturnCode TSHttpTxnClientReqGet(TSHttpTxn txnp, TSMBuffer *bufp,
TSMLoc *offset)
literally the whole signature, no notes. π
π¦ DESCRIPTION π¦
So. You want the client request? This function hands it over. π«Ά
You must pass in txnp, and then bufp and offset get updated so they point at the client request inside that transaction. That's the vibe.
A typical use case lowkey looks like this:
int
CB_Read_Req_Hdr_Hook(TSCont contp, TSEvent event, void* data) {
auto txnp = reinterpret_cast<TSHttpTxn>(data);
TSMBuffer creq_buff;
TSMLoc creq_loc;
if (TS_SUCCESS == TSHttpTxnClientReqGet(txnp, &creq_buff, &creq_loc)) {
// use the client request
} // else values in creq_buff, creq_loc are garbage.
TSHttpTxnReenable(txnp);
return 0;
}
β οΈ okay important: if it does not returnTS_SUCCESS, then the values sitting increq_buffandcreq_locare garbage. Not "maybe fine". Garbage. Do not use them, bestie. π
The values that get placed into bufp and offset are stable for the transaction, which means you only need to retrieve them once per transaction</> β no need to keep calling this thing like it's a group chat you're refreshing. π
And heads up: those values are valid only if this function returns TS_SUCCESS. That's the whole rule. Periodt. π
π COPYRIGHT π
2026, dev@trafficserver.apache.org
and that's the whole page, bestie!! π§ this was Apache Traffic Server version 9.2, dated Feb 12, 2026, and yes the function name is a whole mouthful β TSHttpTxnClientReqGet, section 3ts β but you ate that. πβ¨π mwah, go write some slay plugins ππ
π¦ where this page comes from
- ubuntu noble: trafficserver-dev 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms