I have noticed the problem only appears with uWSGI 0.9.8 (64bit) rather than uWSGI 0.9.9.1 (64bit) at the original machine. I though I ran it uWSGI 0.9.9.1 but I didn't :S
I have read the commits, the problem I encountered should caused by problem fixed by this commit 014805863eae) fixed stupid bug in wsgi.input readline But however, it can't tell why only the first \n disappear. :S At least, I have tested it in different environment, I think it works correctly with 0.9.9.1 for my test cases. 2011/9/5 Victor Lin <[email protected]> > With post-buffering, it works fine. > > Oddly enough, I just setup an amazon ec2 instance for reproducing the bug, > but the bug doesn't appear in that instance. The OS I am using in production > is CentOS5, I will try some more on my machines to see with what kind of > environment, the bug will appear. > > 2011/9/5 Roberto De Ioris <[email protected]> > >> >> Il giorno 05/set/2011, alle ore 05:05, Victor Lin ha scritto: >> >> > Hi, To make it easier to reproduce the bug, I just rewrite the test >> files, you can clone the hg repo here. >> > https://bitbucket.org/victorlin/uwsgi_bug/ >> > >> > To run the uwsgi, you can type >> > >> > uwsgi --yaml uwsgi.yaml >> > >> > You need to include the nginx config, too >> > >> > include /path/to/uwsgi_bug/*.nx.conf; >> > >> > With the running wsgi app under uwsgi with nginx, you can then run >> > >> > send_req.py >> > >> > It reads my_req.txt and send to the nginx server. As result, you can see >> > >> > Traceback (most recent call last): >> > File "./wsgi.py", line 5, in application >> > print req.str_POST >> > File "/home/nowin/lib/python2.7/webob/request.py", line 528, in >> str_POST >> > return self._str_POST >> > File "/home/nowin/lib/python2.7/webob/request.py", line 558, in >> _str_POST >> > keep_blank_values=True) >> > File "/usr/local/lib/python2.7/cgi.py", line 508, in __init__ >> > self.read_multi(environ, keep_blank_values, >> strict_parsing) >> > File "/usr/local/lib/python2.7/cgi.py", line 632, in read_multi >> > environ, keep_blank_values, strict_parsing) >> > File "/usr/local/lib/python2.7/cgi.py", line 510, in __init__ >> > self.read_single() >> > File "/usr/local/lib/python2.7/cgi.py", line 647, in read_single >> > self.read_lines() >> > File "/usr/local/lib/python2.7/cgi.py", line 669, in read_lines >> > self.read_lines_to_outerboundary() >> > File "/usr/local/lib/python2.7/cgi.py", line 697, in >> read_lines_to_outerboundary >> > line = self.fp.readline(1<<16) >> > File "/home/nowin/lib/python2.7/webob/request.py", line 1292, in >> readline >> > self._check_disconnect() >> > File "/home/nowin/lib/python2.7/webob/request.py", line 1311, in >> _check_disconnect >> > + "(%d more bytes were expected)" % self.remaining >> > webob.request.DisconnectionError: The client disconnected while >> sending the POST/PUT body (336 more bytes were expected) >> > >> > If you want to see the missing \n ouput, just replace "If True:" in >> wsgi.py with "If False:", the output should be >> > >> > '------WebKitFormBoundaryAQRPBQgGHAhs61hx\r' >> > 'Content-Disposition: form-data; name="image"; >> filename="log.txt"\r\n' >> > 'Content-Type: text/plain\r\n' >> > '\r\n' >> > 'hello\r\n' >> > '------WebKitFormBoundaryAQRPBQgGHAhs61hx\r\n' >> > 'Content-Disposition: form-data; name="name"\r\n' >> > '\r\n' >> > '\r\n' >> > '------WebKitFormBoundaryAQRPBQgGHAhs61hx\r\n' >> > 'Content-Disposition: form-data; name="submit"\r\n' >> > '\r\n' >> > 'Submit\r\n' >> > '------WebKitFormBoundaryAQRPBQgGHAhs61hx--\r\n' >> > >> > As you can see the tail \n is missing in first line. >> > >> > The versions I have tested are uWSGI 0.9.9.1 and uWSGI 0.9.8. The >> version of Nginx is 1.0.4. If you need further information, just tell me. I >> hope this could be helpful for improving uWSGI :) >> > >> > Thanks. >> > Victor Lin. >> >> >> No way to reproduce the error :( >> >> While i try to manage it, can you confirm that enabling post-buffering >> solves the issue ? (you should try with both tiny and big files) >> >> Thanks again >> >> -- >> Roberto De Ioris >> http://unbit.it >> JID: [email protected] >> >> _______________________________________________ >> uWSGI mailing list >> [email protected] >> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi >> > >
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
