> Meanwhile I think I have discovered a bug. When doing the request
> manually, pasting the request to a telnet session, the keepalive works.
> But if I issue the request using cURL, the connection is closed by the
> server after the response is sent.
>
> In the code this section in http.c is entered:
> if (hr->remains > 0) {
> hr->session.can_keepalive = 0;
>
> hr->remains is equal to the length of the request. It seems uWSGI thinks I
> have not read the request but my application has read it and produced a
> response. When I paste the request manually, hr->remains is <= 0.
I think this is more "right" check:
https://github.com/unbit/uwsgi/commit/23843163ad5dd26c5b2fe44f738143b53ba022c4
basically we discard only requests with pipelined requests appended to the
first chunk (that is the real problem, all of the other situations can be
safely managed)
> What I've seen happen is that when a browser is doing a multiple-file
> upload, it will try to reuse the connection and start sending the next
> file before it notices that the connection is being closed. This will
> cause that upload to fail.
never thought about this case (i was not even aware that browsers use the
same connection for multiple uploads). By the way, i suppose forcing
keep-alive only for the status code 200 will be more than enough
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi