Hi, I receive a request, append some custom headers and use "load_gws()" (from LCR module). If the first gateway fails I do "next_gw()" and this second request to the second gateway doesn't contain the previously appended custom headers.
Is it the expected behavior?
Iñaki Baz Castillo writes:
Hi, I receive a request, append some custom headers and use "load_gws()" (from LCR module). If the first gateway fails I do "next_gw()" and this second request to the second gateway doesn't contain the previously appended custom headers.
Is it the expected behavior?
inaki,
lots of questions. i'll try to answer, but i'm multiplexing with dinner preparation.
lcr module does nothing to any headers, just destination set. what i do, i add gw specific headers in branch route block separately for each gw. if your gws share the headers, you should be able to add them in route block before starting to call next_gw()s and t_relay().
-- juha
2010/4/20 Juha Heinanen jh@tutpro.com:
lcr module does nothing to any headers, just destination set. what i do, i add gw specific headers in branch route block separately for each gw. if your gws share the headers, you should be able to add them in route block before starting to call next_gw()s and t_relay().
Hi, yes, a workaround is adding the headers in branch_route, it works. However I wonder if the expected behavior is that added headers are not keep in serial forking. Well, it could make sense. I just want to confirm.
Thanks.
2010/4/20 Iñaki Baz Castillo ibc@aliax.net:
Hi, yes, a workaround is adding the headers in branch_route, it works. However I wonder if the expected behavior is that added headers are not keep in serial forking. Well, it could make sense. I just want to confirm.
Issue solved!
The problem is that I was calling t_newtran() at some point in the script, and as the documentation states:
------------- 1.4.1. t_newtran() Creates a new transaction, returns a negative value on error. This is the only way a script can add a new transaction in an atomic way. Typically, it is used to deploy a UAS. Warning NOTE that the changes on the request that are made after this function call will not be saved into transaction!!! ------------
On 04/20/2010 12:46 PM, Iñaki Baz Castillo wrote:
2010/4/20 Juha Heinanenjh@tutpro.com:
lcr module does nothing to any headers, just destination set. what i do, i add gw specific headers in branch route block separately for each gw. if your gws share the headers, you should be able to add them in route block before starting to call next_gw()s and t_relay().
Hi, yes, a workaround is adding the headers in branch_route, it works. However I wonder if the expected behavior is that added headers are not keep in serial forking. Well, it could make sense. I just want to confirm.
I too am surprised by this. It seems to me that if headers are added prior to forking, then all existing headers--including the appended ones--should be copied into every new branch.
2010/4/20 Alex Balashov abalashov@evaristesys.com:
Hi, yes, a workaround is adding the headers in branch_route, it works. However I wonder if the expected behavior is that added headers are not keep in serial forking. Well, it could make sense. I just want to confirm.
I too am surprised by this. It seems to me that if headers are added prior to forking, then all existing headers--including the appended ones--should be copied into every new branch.
Hi Alex, read my last mail in this thread in which I explain that the error occurs since I used t_newtran() at the begining of the script and then "changes on the request that are made after this function call will not be saved into transaction!!!" (as the documentation says).
Regards.
On 04/20/2010 05:08 PM, Iñaki Baz Castillo wrote:
2010/4/20 Alex Balashovabalashov@evaristesys.com:
Hi, yes, a workaround is adding the headers in branch_route, it works. However I wonder if the expected behavior is that added headers are not keep in serial forking. Well, it could make sense. I just want to confirm.
I too am surprised by this. It seems to me that if headers are added prior to forking, then all existing headers--including the appended ones--should be copied into every new branch.
Hi Alex, read my last mail in this thread in which I explain that the error occurs since I used t_newtran() at the begining of the script and then "changes on the request that are made after this function call will not be saved into transaction!!!" (as the documentation says).
Oh. OK, that is clearer. Sorry, I was being dumb.