You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by supraja sridhar <su...@gmail.com> on 2018/01/04 13:14:41 UTC

Transaction object inside transform handler

Hi,

I have a plugin registered for the REQUEST_TRANSFORM_HOOK, is there a way
to access the transaction object in the handler function?
My objective is to reenable the transaction with a TS_EVENT_HTTP_ERROR
inside the tranform handler function.

Thanks,
Supraja

Re: Transaction object inside transform handler

Posted by supraja sridhar <su...@gmail.com>.
Thank you. It worked.

On Fri, Jan 5, 2018 at 4:52 PM, Chao Xu <ok...@apache.org> wrote:

> You can not reenable the Txn within the transform handler function.
>
> But you can send TS_EVENT_ERROR to the input (source) by :
>
>     input_vio = TSVConnWriteVIOGet(contp);
>     TSContCall(TSVIOContGet(input_vio), TS_EVENT_ERROR, input_vio);
>
> And then you can hook with the HTTP_SEND_RESPONSE_HDR_HOOK and change the
> response to what you want.
>
> - Oknet
>
> 2018-01-04 21:14 GMT+08:00 supraja sridhar <su...@gmail.com>:
>
>> Hi,
>>
>> I have a plugin registered for the REQUEST_TRANSFORM_HOOK, is there a way
>> to access the transaction object in the handler function?
>> My objective is to reenable the transaction with a TS_EVENT_HTTP_ERROR
>> inside the tranform handler function.
>>
>> Thanks,
>> Supraja
>>
>
>


-- 
Regards,
Supraja

Re: Transaction object inside transform handler

Posted by Chao Xu <ok...@apache.org>.
You can not reenable the Txn within the transform handler function.

But you can send TS_EVENT_ERROR to the input (source) by :

    input_vio = TSVConnWriteVIOGet(contp);
    TSContCall(TSVIOContGet(input_vio), TS_EVENT_ERROR, input_vio);

And then you can hook with the HTTP_SEND_RESPONSE_HDR_HOOK and change the
response to what you want.

- Oknet

2018-01-04 21:14 GMT+08:00 supraja sridhar <su...@gmail.com>:

> Hi,
>
> I have a plugin registered for the REQUEST_TRANSFORM_HOOK, is there a way
> to access the transaction object in the handler function?
> My objective is to reenable the transaction with a TS_EVENT_HTTP_ERROR
> inside the tranform handler function.
>
> Thanks,
> Supraja
>