Re: Buffers Chain

2014-05-27 Thread Maxim Dounin
Hello! On Tue, May 27, 2014 at 09:15:28AM +0100, Paulo Silva wrote: > Hi, > One more question about buffers chains. > > Is it possible to a body_filter to say to the engine to hang up client > streaming? > Maybe say "keep it in memory" (there are a plenty undocumented > ngx_chain_t members). >

Re: Buffers Chain

2014-05-27 Thread Paulo Silva
Hi, One more question about buffers chains. Is it possible to a body_filter to say to the engine to hang up client streaming? Maybe say "keep it in memory" (there are a plenty undocumented ngx_chain_t members). I'm searching for "" on response body and one possibility is to get, i.e., "" at the b

Re: Buffers Chain

2014-05-26 Thread SplitIce
Theres actually an example using the memcached module (and echo module to get the request body). The main advantage to the lua module is if you wanted to do something custom (e.g processing) or transmit it over a different protocol not available as an extension. On Mon, May 26, 2014 at 7:17 PM, P

Re: Buffers Chain

2014-05-26 Thread Paulo Silva
On Mon, May 26, 2014 at 9:28 AM, SplitIce wrote: > Yes, connecting with SOCK_NONBLOCK shouldnt block. I don't believe this is > mentioned previously. If your code blocks (e.g blocking connect or blocking > send) then it would reduce nginx throughput substantially. Thats the point I > was trying to

Re: Buffers Chain

2014-05-26 Thread SplitIce
Yes, connecting with SOCK_NONBLOCK shouldnt block. I don't believe this is mentioned previously. If your code blocks (e.g blocking connect or blocking send) then it would reduce nginx throughput substantially. Thats the point I was trying to make. Have you investigated srcache ( https://github.com

Re: Buffers Chain

2014-05-26 Thread Paulo Silva
On Mon, May 26, 2014 at 9:09 AM, SplitIce wrote: > As in blocking send and connect? I don't know the specifics of Unix Sockets, > but don't they block when the buffer fills (I know FIFO queues do)? > Sorry, I don't fully understand your question. I was expecting that with the SOCK_NONBLOCK it wou

Re: Buffers Chain

2014-05-26 Thread SplitIce
As in blocking send and connect? I don't know the specifics of Unix Sockets, but don't they block when the buffer fills (I know FIFO queues do)? On Mon, May 26, 2014 at 9:22 AM, Paulo Silva wrote: > Hi, > I'm not sure whether I will face problems with other filters modifying > the response body

Re: Buffers Chain

2014-05-25 Thread Paulo Silva
Hi, I'm not sure whether I will face problems with other filters modifying the response body after mine, but for know I'm comfortable as I can rebuild the full response body just iterating buffers chains. As I said before I'm using nginx as reverse proxy and my main goal is to pass the upstream (p

Re: Buffers Chain

2014-05-23 Thread Paulo Silva
Because I don't have deep knowledge of nginx internal and I can not find a proper resource about it, the best I can do and with what I am comfortable is with body_filter. Do you think I can notice whether all other 3rd party module filters finish modifying the ngx_chain_t *in ? On Fri, May 23,

Re: Buffers Chain

2014-05-23 Thread Maxim Dounin
Hello! On Fri, May 23, 2014 at 02:17:27PM +0100, Paulo Silva wrote: > Hi, > > On Fri, May 23, 2014 at 12:58 PM, Maxim Dounin wrote: > > Hello! > > > > On Fri, May 23, 2014 at 11:57:20AM +0100, Paulo Silva wrote: > > > >> there is other option than modify the auto/modules file? > >> > >> Accordi

Re: Buffers Chain

2014-05-23 Thread Paulo Silva
Hi, On Fri, May 23, 2014 at 12:58 PM, Maxim Dounin wrote: > Hello! > > On Fri, May 23, 2014 at 11:57:20AM +0100, Paulo Silva wrote: > >> there is other option than modify the auto/modules file? >> >> According to my goal (capture the full request response body) I would >> say that my module must

Re: Buffers Chain

2014-05-23 Thread Maxim Dounin
Hello! On Fri, May 23, 2014 at 11:57:20AM +0100, Paulo Silva wrote: > there is other option than modify the auto/modules file? > > According to my goal (capture the full request response body) I would > say that my module must run right before the postpone. Before the postpone filter you'll get

Re: Buffers Chain

2014-05-23 Thread Paulo Silva
there is other option than modify the auto/modules file? According to my goal (capture the full request response body) I would say that my module must run right before the postpone. Am I supposed to modify the auto/modules like follows? if [ $HTTP_POSTPONE = YES ]; then HTTP_FILTER_MODULES="$

Re: Buffers Chain

2014-05-23 Thread Maxim Dounin
Hello! On Fri, May 23, 2014 at 10:23:38AM +0100, Paulo Silva wrote: > @Maxim: nice hints, thanks. > > Let me ask you about filters order. To get the contents that will be > sent to client, I want to run my body_filter right before the gziping. > How to accomplish that or if it is even possible >

Re: Buffers Chain

2014-05-23 Thread Paulo Silva
@Maxim: nice hints, thanks. Let me ask you about filters order. To get the contents that will be sent to client, I want to run my body_filter right before the gziping. How to accomplish that or if it is even possible I am worried that copying the buffers content the original ones can be yet modif

Re: Buffers Chain

2014-05-23 Thread Maxim Dounin
Hello! On Thu, May 22, 2014 at 03:21:56PM +0100, Paulo Silva wrote: > Hi, > Let me introduce the Elephant in the room. My name is Paulo and I'm > from Portugal. > I am starting developing nginx modules and I'm having a great time > with buffers chain :D > > I'm using nginx as a reverse proxy and