Welcome! Log In Create A New Profile

Advanced

Fastcgi chunked data

Shaun savage
August 18, 2011 08:40PM
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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Fastcgi chunked data

Shaun savage August 18, 2011 08:40PM

Re: Fastcgi chunked data

Ensiferous August 19, 2011 12:45AM

Re: Fastcgi chunked data

Maxim Dounin August 19, 2011 03:40AM

Re: Fastcgi chunked data

Shaun savage August 19, 2011 05:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready