> If I send a POST request and I don't read body (post data) in my app, but
> immediately replied, eg:
>
> def application(env, sr):
>       sr('200 Ok', [('Content-Type', 'text/html')])
>       return b'hello'
>
> nginx log:
> 2011/03/11 14:35:52 [error] 6304#0: *60459 readv() failed (104: Connection
> reset by peer) while reading upstream, client: 127.0.1.1, server: t3,
> request: "POST / HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi-t3.sock:",
> host: "t3"
>
> If you will read the body, then all is ok.


This must be changed in nginx, there is nothing uWSGI can do.
(a patch was already sent some time ago by maxim dunin but not entered the
official tree)

By the way in 0.9.7 you can change the way post data are managed:

--pep333-input
--post-buffering 4096

will delegate to uWSGI all the reading of post data.

wsgi.input will became a custom object (this is triggered by --pep333-input)
that will read in memory all the data <= 4096 bytes and save it to a file
all the others.

Even unsized reads will not block (as asked by pyramid community).

This is not very well tested, so every report will be wellcomed.


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to