You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/07/20 11:02:59 UTC

[GitHub] [trafficserver] jhiapple commented on pull request #7931: Adds new X-Effective-URL header to the xdebug plugin

jhiapple commented on pull request #7931:
URL: https://github.com/apache/trafficserver/pull/7931#issuecomment-883302349


   
   
   > On 14. Jul 2021, at 0.40, Walt Karas ***@***.***> wrote:
   > 
   > 
   > @ywkaras commented on this pull request.
   > 
   > In plugins/xdebug/xdebug.cc <https://github.com/apache/trafficserver/pull/7931#discussion_r669129269>:
   > 
   > > +    int len;
   > +  } strval = {nullptr, 0};
   > +
   > +  TSDebug("xdebug", "attempting to inject X-Effective-URL header");
   > +
   > +  strval.ptr = TSHttpTxnEffectiveUrlStringGet(txn, &strval.len);
   > +
   > +  if (strval.ptr != nullptr && strval.len > 0) {
   > +    dst = FindOrMakeHdrField(buffer, hdr, "X-Effective-URL", lengthof("X-Effective-URL"));
   > +    if (dst != TS_NULL_MLOC) {
   > +      TSReleaseAssert(TSMimeHdrFieldValueStringInsert(buffer, hdr, dst, -1 /* idx */, strval.ptr, strval.len) == TS_SUCCESS);
   > +    }
   > +  }
   > +
   > +  if (dst != TS_NULL_MLOC) {
   > +    TSHandleMLocRelease(buffer, hdr, dst);
   > You could move this between lines 397 and 398, and eliminate this if statement. Once you did that, you could declare dst on line 395 and delete line 303.
   > 
   > 
   
   Tighter scope nice, so done in https://github.com/apache/trafficserver/pull/7931/commits/60252d542c5b5d49b81d135ead0c631bab03f9ed
   > —
   > You are receiving this because you were assigned.
   > Reply to this email directly, view it on GitHub <https://github.com/apache/trafficserver/pull/7931#pullrequestreview-705671141>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AUNMHZ63AILPY54BHQIRUYTTXSXDNANCNFSM46MQSQMA>.
   > 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org