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

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

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

    https://github.com/apache/trafficserver/pull/442#discussion_r51277409
  
    --- Diff: lib/atscppapi/src/Transaction.cc ---
    @@ -433,14 +411,12 @@ class initializeHandles
       initializeHandles(GetterFunction getter) : getter_(getter) {}
       bool operator()(TSHttpTxn txn, TSMBuffer &hdr_buf, TSMLoc &hdr_loc, 
const char *handles_name)
       {
    -    if (!hdr_buf && !hdr_loc) {
    -      if (getter_(txn, &hdr_buf, &hdr_loc) == TS_SUCCESS) {
    -        return true;
    -      } else {
    -        LOG_ERROR("Could not get %s", handles_name);
    -      }
    +    hdr_buf = NULL;
    +    hdr_loc = NULL;
    +    if (getter_(txn, &hdr_buf, &hdr_loc) == TS_SUCCESS) {
    +      return true;
         } else {
    -      LOG_ERROR("%s already initialized", handles_name);
    +      LOG_ERROR("Could not get %s", handles_name);
    --- End diff --
    
    The handles inside the Request and Response objects need to be reset here 
as well, otherwise, plugins may reference invalid handles via those objects.


> C++ api coredumps when used with other plugins using TSHttpTxnRedirectUrlSet.
> -----------------------------------------------------------------------------
>
>                 Key: TS-4135
>                 URL: https://issues.apache.org/jira/browse/TS-4135
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: CPP API
>            Reporter: Sandeep Davu
>            Assignee: Brian Geffon
>              Labels: crash
>             Fix For: 6.2.0
>
>
> There are  multiple TS_EVENT_HTTP_SEND_REQUEST_HDR and 
> TS_EVENT_HTTP_READ_RESPONSE_HDR for plugins that use TSHttpTxnRedirectUrlSet.
> Transaction object ignores these events.
> Ideally these events should be handled by reinitializing the server_request 
> and server_response.



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

Reply via email to