[ 
https://issues.apache.org/jira/browse/TS-4550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355463#comment-15355463
 ] 

ASF GitHub Bot commented on TS-4550:
------------------------------------

Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/745#discussion_r68973675
  
    --- Diff: plugins/experimental/xdebug/xdebug.cc ---
    @@ -234,6 +237,20 @@ InjectMilestonesHeader(TSHttpTxn txn, TSMBuffer 
buffer, TSMLoc hdr)
       }
     }
     
    +static void
    +InjectTxnUuidHeader(TSHttpTxn txn, TSMBuffer buffer, TSMLoc hdr)
    +{
    +  TSMLoc dst = FindOrMakeHdrField(buffer, hdr, "X-Transaction-Id", 
lengthof("X-Transaction-Id"));
    +
    +  if (TS_NULL_MLOC != dst) {
    +    char buf[TS_UUID_STRING_LEN + 22]; // Padded for int64_t (20) + 1 
('-') + 1 ('\0')
    +    TSUuid uuid = TSProcessUuidGet();
    +    int len     = snprintf(buf, sizeof(buf) - 1, "%s-%" PRIu64 "", 
TSUuidStringGet(uuid), TSHttpTxnIdGet(txn));
    +
    +    TSReleaseAssert(TSMimeHdrFieldValueStringInsert(buffer, hdr, dst, 0 /* 
idx */, buf, len) == TS_SUCCESS);
    +  }
    --- End diff --
    
    ```C
      if (dst != TS_NULL_MLOC) {
        TSHandleMLocRelease(buffer, hdr, dst);
      }
    ```


> xdebug: Add support for new UUID APIs
> -------------------------------------
>
>                 Key: TS-4550
>                 URL: https://issues.apache.org/jira/browse/TS-4550
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Plugins
>            Reporter: Leif Hedstrom
>            Assignee: Leif Hedstrom
>             Fix For: 7.0.0
>
>
> E.g. X-Debug: ATS-Txn-UUID



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

Reply via email to