[PATCH] NGX_HTTP_SYNC flag in ngx_http_send_special
manlio.perillo at gmail.com
Fri May 4 17:52:33 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Patch is attached, against mercurial mirror changeset 47cb3497fbab.
I'm updating my ngx_http_wsgi_module.
In one of my test application, I return a chunk-encoded response.
The problem is that after last buffer is sent, I raise an exception,
causing Nginx to abort the request handling.
This, in turn, cause an incorrect chunk encoding (Python httplib fails
to read the response).
after last buffer does not help, however I found that using my patch,
ngx_http_send_special(r, NGX_HTTP_FLUSH | NGX_HTTP_SYNC)
do help; now the response is correctly chunk encoded.
Please note that I tested my patch using 0.7.59, since
ngx_http_wsgi_module has some issues on recent Nginx versions (that I'm
going to fix).
Also note that I can not use NGX_HTTP_LAST (due to how
ngx_http_wsgi_module is implemented), and I'm not sure if is it correct
to set sync = 1 for a buffer that is not the last one.
Thanks Manlio Perillo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the nginx-devel