Fastcgi chunked data

Shaun savage savages at mozapps.com
Fri Aug 19 00:39:02 UTC 2011


I have a fastcgi server connection that send chunks of data.  I would
like to have the chucks of data written to downstream, not buffered.

I want to send chunked data from the server, but nginx buffers the data,
I want to flush the data immediately.


I have found the "trunk" 1.1.0 code almost works. 

1> The event happens
2> the pipe is read
3> something is checked??????
4> the data is buffered, not written downstream
5> try to write down stream, but no buffer,  Why?
5> checks upstream again
6> starts timer again


 I have traced the code but I get lost at

[debug] 2842#0: *4 pipe recv chain: -2
        src/event/ngx_event_pipe.c:272
            n = p->upstream->recv_chain(p->upstream, chain);

            ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
                           "pipe recv chain: %z", n);
AND

why there is no buffer to write?
[debug] 2842#0: *4 pipe write downstream: 1 0000000000000000


2011/08/18 17:26:01 [debug] 2842#0: *4 post event 0000000001FF1BF0
2011/08/18 17:26:01 [debug] 2842#0: *4 post event 0000000002005400
2011/08/18 17:26:01 [debug] 2842#0: *4 delete posted event 0000000002005400
2011/08/18 17:26:01 [debug] 2842#0: *4 http upstream request:
"/mafw/weiqi.psh?" 1
2011/08/18 17:26:01 [debug] 2842#0: *4 http upstream dummy handler
2011/08/18 17:26:01 [debug] 2842#0: *4 delete posted event 0000000001FF1BF0
2011/08/18 17:26:01 [debug] 2842#0: *4 http upstream request:
"/mafw/weiqi.psh?" 0
2011/08/18 17:26:01 [debug] 2842#0: *4 http upstream process upstream
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe read upstream: 1
2011/08/18 17:26:01 [debug] 2842#0: *4 readv: 2:4096
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe recv chain: 144
2011/08/18 17:26:01 [debug] 2842#0: *4 readv: 2:4096
2011/08/18 17:26:01 [debug] 2842#0: *4 readv() not ready (11: Resource
temporarily unavailable)
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe recv chain: -2
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe buf free s:0 t:1 f:0
0000000001FC9750, pos 0000000001FC9750, size: 3368 file: 0, size: 0
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe buf free s:0 t:1 f:0
0000000001FC7730, pos 0000000001FC7730, size: 0 file: 0, size: 0
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe write downstream: 1
0000000000000000
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe write busy: 0
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe write: out:0000000000000000, f:0
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe read upstream: 0
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe buf free s:0 t:1 f:0
0000000001FC9750, pos 0000000001FC9750, size: 3368 file: 0, size: 0
2011/08/18 17:26:01 [debug] 2842#0: *4 pipe buf free s:0 t:1 f:0
0000000001FC7730, pos 0000000001FC7730, size: 0 file: 0, size: 0
2011/08/18 17:26:01 [debug] 2842#0: *4 event timer del: 20: 1313659596126
2011/08/18 17:26:01 [debug] 2842#0: *4 event timer add: 20:
60000:1313659621126



More information about the nginx mailing list