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

Function getPristineUrlPath

plugins/prefetch/plugin.cc:301–322  ·  view source on GitHub ↗

* @brief get the pristin URL path * * @param txnp HTTP transaction structure * @return pristine URL path */

Source from the content-addressed store, hash-verified

299 * @return pristine URL path
300 */
301static String
302getPristineUrlPath(TSHttpTxn txnp)
303{
304 String pristinePath;
305 TSMLoc pristineUrlLoc;
306 TSMBuffer reqBuffer;
307
308 if (TS_SUCCESS == TSHttpTxnPristineUrlGet(txnp, &reqBuffer, &pristineUrlLoc)) {
309 int pathLen = 0;
310 const char *path = TSUrlPathGet(reqBuffer, pristineUrlLoc, &pathLen);
311 if (nullptr != path) {
312 PrefetchDebug("path: '%.*s'", pathLen, path);
313 pristinePath.assign(path, pathLen);
314 } else {
315 PrefetchError("failed to get pristine URL path");
316 }
317 TSHandleMLocRelease(reqBuffer, TS_NULL_MLOC, pristineUrlLoc);
318 } else {
319 PrefetchError("failed to get pristine URL");
320 }
321 return pristinePath;
322}
323
324/**
325 * @brief get the pristin URL querystring

Callers 2

contHandleFetchFunction · 0.85
TSRemapDoRemapFunction · 0.85

Calls 4

TSHttpTxnPristineUrlGetFunction · 0.85
TSUrlPathGetFunction · 0.85
TSHandleMLocReleaseFunction · 0.85
assignMethod · 0.45

Tested by

no test coverage detected