Hello,
I've run into a situation where I would like to set the response to a request 
to certain content. I know that i can use TSHttpTxnSetHttpRetBody and 
TSHttpTxnSetHttpRetStatus the problem with this is that TSHttpTxnSetHttpRetBody 
sets the HttpTransact::State->return_xbuf to accomplish this which has a limit 
of 2*1024 bytes, unfortunately this is far too low for what I'm trying to do. I 
understand that these API functions were probably originally designed to be 
used as error pages for the remap plugin, but I figure they could easily suit 
my purpose too.

I was thinking that about making the following changes to make this possible:
Change HttpTransact::State::return_xbuf to be a char * instead of char [2*1024].
In TSHttpTxnSetHttpRetBody I would use TSmalloc() to allocate the space and 
then free in State::destroy() and that way it could support an arbitrary sized 
response. I will happily submit a patch with these changes if no one sees any 
issues with my proposed modifications.

Of course, if there is another way to accomplish this same thing I would really 
appreciate any feedback.

Best,
Brian

Reply via email to