[
https://issues.apache.org/jira/browse/TS-4703?focusedWorklogId=28784&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28784
]
ASF GitHub Bot logged work on TS-4703:
--------------------------------------
Author: ASF GitHub Bot
Created on: 12/Sep/16 15:59
Start Date: 12/Sep/16 15:59
Worklog Time Spent: 10m
Work Description: Github user SolidWallOfCode commented on a diff in the
pull request:
https://github.com/apache/trafficserver/pull/1007#discussion_r78400907
--- Diff: iocore/net/P_UnixNetVConnection.h ---
@@ -170,6 +170,38 @@ class UnixNetVConnection : public NetVConnection
/////////////////////////////////////////////////////////////////
UnixNetVConnection();
+ int
+ populate_protocol(char const **results, int n) const
+ {
+ int retval = 0;
+ if (n > 0) {
+ results[0] = options.get_proto_string();
+ retval++;
+ if (n > 1) {
+ results[1] = options.get_family_string();
+ retval++;
+ }
+ }
+ return retval;
+ }
+
+ const char *
+ protocol_contains(const char *tag) const
+ {
+ const char *retval = NULL;
+ unsigned int tag_len = strlen(tag);
+ const char *test_tag = options.get_proto_string();
+ if (tag_len <= strlen(test_tag) && strncmp(tag, test_tag, tag_len) ==
0) {
--- End diff --
Don't need to do the `strlen`, `strncmp` will stop (and fail) if the
protocol tag has a null termination.
Issue Time Tracking
-------------------
Worklog Id: (was: 28784)
Time Spent: 4h 10m (was: 4h)
> 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
> Assignee: Susan Hinrichs
> Fix For: 7.0.0
>
> Time Spent: 4h 10m
> 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)