Handle chunked from gunicorn properly.
authorAntony Chazapis <chazapis@gmail.com>
Tue, 18 Oct 2011 10:22:35 +0000 (13:22 +0300)
committerroot <root@pithos.dev.grnet.gr>
Tue, 18 Oct 2011 10:22:35 +0000 (13:22 +0300)
pithos/api/util.py

index 09d09ca..d21e237 100644 (file)
@@ -500,7 +500,7 @@ def socket_read_iterator(request, length=0, blocksize=4096):
     sock = raw_input_socket(request)
     if length < 0: # Chunked transfers
         # Small version (server does the dechunking).
-        if request.environ.get('mod_wsgi.input_chunked', None):
+        if request.environ.get('mod_wsgi.input_chunked', None) or request.META['SERVER_SOFTWARE'].startswith('gunicorn'):
             while length < MAX_UPLOAD_SIZE:
                 data = sock.read(blocksize)
                 if data == '':