[ 
https://issues.apache.org/jira/browse/TS-5030?focusedWorklogId=31552&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31552
 ]

ASF GitHub Bot logged work on TS-5030:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Nov/16 18:13
            Start Date: 03/Nov/16 18:13
    Worklog Time Spent: 10m 
      Work Description: Github user bryancall commented on a diff in the pull 
request:

    https://github.com/apache/trafficserver/pull/1184#discussion_r86408908
  
    --- Diff: proxy/InkAPI.cc ---
    @@ -9212,6 +9213,19 @@ TSUuidStringGet(const TSUuid uuid)
       return nullptr;
     }
     
    +const char *
    +TSClientRequestUuidGet(TSHttpTxn txnp)
    +{
    +  TSUuid process = TSProcessUuidGet();
    +  if (process) {
    +    std::ostringstream oss;
    +    oss << TSUuidStringGet(process) << '-' << TSHttpTxnIdGet(txnp);
    +    return oss.str().c_str();
    --- End diff --
    
    You are retuning a pointer of the data inside of a locally scoped variable. 
 I would suggest doing a ats_malloc() since you know the size of the string and 
a memcpy() of the values.  Callers will need to call TSfree to free the memory.


Issue Time Tracking
-------------------

    Worklog Id:     (was: 31552)
    Time Spent: 20m  (was: 10m)

> Proposal: Add API to get the client request UUID directly from a TSHttpTx
> -------------------------------------------------------------------------
>
>                 Key: TS-5030
>                 URL: https://issues.apache.org/jira/browse/TS-5030
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: TS API
>            Reporter: David Calavera
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The new UUID api introduced in 
> https://github.com/apache/trafficserver/pull/736 is great for tracing 
> operations and requests. However, the most useful information for plugin 
> developers, the unique client request id, is not exposed as an api endpoint. 
> People need to understand very well how TrafficServer works internally to 
> generate this value. By not having the API directly exposed, people need to 
> repeat the same code every time they want to generate this unique identifier.
> I'd like to add an API enpoint to generate this identifier based in a given 
> http transaction for plugins to use.
> This would be the signature:
> tsapi const char * TSClientRequestUuidGet(TSHttpTxn txnp);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to