[
https://issues.apache.org/jira/browse/TS-4703?focusedWorklogId=26216&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26216
]
ASF GitHub Bot logged work on TS-4703:
--------------------------------------
Author: ASF GitHub Bot
Created on: 05/Aug/16 22:36
Start Date: 05/Aug/16 22:36
Worklog Time Spent: 10m
Work Description: Github user SolidWallOfCode commented on a diff in the
pull request:
https://github.com/apache/trafficserver/pull/829#discussion_r73769080
--- Diff: proxy/InkAPI.cc ---
@@ -4655,6 +4655,15 @@ TSHttpTxnClientReqGet(TSHttpTxn txnp, TSMBuffer
*bufp, TSMLoc *obj)
return TS_ERROR;
}
+const char *
+TSHttpTxnClientProtocolGet(TSHttpTxn txnp)
+{
+ sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+
+ HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
+ return sm->ua_session->get_protocol_string();
--- End diff --
What's the status on this? I am +1 on adding the API, it's often useful to
get the actual protocol in use by the user agent and I don't see a better
mechanism to do it. You could do this long ago, sort of, using the ProtoSet
stuff, but that was much more fragile. One of the motivations for the TS-3612
work was to be able to implement this easily. Internally the HttpSM doesn't
have to know, it can just pass the query on to the HttpProxyClientTransaction
and reliably get an accurate result.
I know James thinks there is a better way, but I don't see it. Querying via
the HttpSM or ClientSession (HttpTxn or HttpSsn) seems quite natural. I suppose
we could say it only makes sense for the session object but that's just making
work for the plugin since it would simply call TSHttpTnSsnGet(). I originally
had a vision where the API would enable walking up the protocol stack for the
user agent but I now think that might be too much as no one has asked for such
capability.
One thing that should be brought up is the detection of TLS/SSL on the user
agent connection. Should this be considered a protocol layer under say HTTP/2,
or have independent API? I'd prefer something more unified if we can get it.
Issue Time Tracking
-------------------
Worklog Id: (was: 26216)
Time Spent: 2.5h (was: 2h 20m)
> Adds an API call to retrieve transaction protocol
> -------------------------------------------------
>
> Key: TS-4703
> URL: https://issues.apache.org/jira/browse/TS-4703
> Project: Traffic Server
> Issue Type: Improvement
> Components: TS API
> Reporter: Petar Penkov
> Fix For: 7.0.0
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> It would be useful if there was a way to retrieve the underlying protocol for
> a given transaction through the tsapi at the very least for plugin logging
> purposes. This can be achieved with a very simple method since this
> information is already available internally.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)