[
https://issues.apache.org/jira/browse/TS-998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187345#comment-13187345
]
Leif Hedstrom commented on TS-998:
----------------------------------
I'm assuming that
{code}
if (must_copy && s_str) {
s_str = heap->duplicate_str(s_str, s_len);
}
{code}
will have to copy the string version of something (sounds like the entire
request URL + header). Maybe that is cheap. As for the logging, that string is
only used (afaik) if you use the cquuc tag in a custom log (it would not be
used in the default logs, or error logs). We could perhaps change that if/where
it makes sense.
What I'm saying is, what would make most sense to me personally would be to
keep an immutable request object before remap happens, and then we can use
normal APIs on that. This would remove the need for the PristineUrl API, and
this string version of the request URL for logging (which is created solely for
logging, if someone uses the cquuc tag in a custom log).
> Broken ClientReq in TSAPI
> -------------------------
>
> Key: TS-998
> URL: https://issues.apache.org/jira/browse/TS-998
> Project: Traffic Server
> Issue Type: Bug
> Affects Versions: 3.0.1
> Environment: any
> Reporter: Nick Kew
> Assignee: Nick Kew
> Fix For: 3.1.2
>
>
> Extracting a Request using TSHttpTxnClientReqGet API yields a bogus Request
> line.
> Expected behaviour: In a PRE_REMAP hook it should return the client request
> line and headers, ideally verbatim.
> Observed behaviour: "http://" is prepended to the request URL:
> GET /path/ HTTP/1.1
> becomes
> GET http:///path/ HTTP/1.1
> (yes, that's three slashes)
> Pseudo-code to reproduce from a PRE_REMAP hook:
> TSHttpTxnClientReqGet(txnp, &buf, &hdr);
> TSHttpHdrPrint(buf, hdr, iobuf);
> reader = TSIOBufferReaderAlloc(iobuf);
> block = TSIOBufferReaderStart(reader);
> len = TSIOBufferBlockReadAvail(block, reader);
> data = TSIOBufferBlockReadStart(block, reader, &len);
> Now examine the contents of data.
> Assigned to AMC as suggested yesterday on-list.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira