trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <jpe...@apache.org>
Subject Re: Escalate and TSHttpTxnErrorBodySet
Date Tue, 06 May 2014 15:53:23 GMT
On May 6, 2014, at 8:21 AM, Scott Beardsley <sbeards@yahoo-inc.com> wrote:

> Sorry for the subject set fail...
> 
> On Tuesday, May 6, 2014 8:18 AM, Scott Beardsley <sbeards@yahoo-inc.com> wrote:
> Hey all, we are trying patch escalate[1][2] to intercept a response based on some criteria
(like configuration and response status) and modify the contents of the response body without
dropping the connection to the origin. So far TSHttpTxnErrorBodySet() looks good but since
it appears to require the TS_EVENT_HTTP_ERROR state it won't work. According to the following
comments, and our real-world observations, it drops the transaction (and the connection to
the origin):
> 
> Comments from ts.h:
> 
>         - TS_EVENT_HTTP_ERROR which terminates the transaction
> 
>           and sends an error to the client if no response has already
>           been sent.

The way the escalation plugin was intended to work was to follow a chain of redirects until
it reached an origin that could send the desired content. In this model, there's never a need
to set the response body from the plugin.

> Any guidance on what API to use which will allow modifying the response body without
terminating the connection to the origin? Can we only do this with a transform plugin? TSHttpTxnErrorBodySet
appears to do exactly what we want but it drops the connection to the origin. Maybe there
is room for a similar api call to do the same but keep the connection to the origin live?
Or maybe a new "soft-fail" state for errors which are not catastrophic and do not require
a new connection be established?
> 
> We tried using TS_EVENT_HTTP_CONTINUE but then the call to TSHttpTxnErrorBodySet produces
an INKAPI error.
> 
> Thanks,
> Scott
> --
> [1] https://cwiki.apache.org/confluence/display/TS/EscalationPlugin
> [2] https://github.com/apache/trafficserver/blob/master/plugins/experimental/escalate/escalate.cc
> 


Mime
View raw message