Copterfly / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Revise use of types for amount of data sent or content length. #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Code isn't particularly consistent as to what type it uses where length of
content is being specified. Some times it uses 'int', some times 'long' and
other times 'apr_off_t'. For generated content, excluding wsgi.file_wrapper
then 2GB is probably maximum length of single value. There is also no
attempt to use Python specific type for string length introduced with
Python 2.5.

Thus, all code dealing with content needs to be revised and made consistent.

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 21 Feb 2008 at 12:14

GoogleCodeExporter commented 9 years ago
To get around the limitation for large files when using wsgi.file_wrapper, then 
you cannot set Content-Length 
response header as that itself is also restricted to 2GB. Simply don't set 
Content-Length and wsgi.file_wrapper 
will internally set that header with correct length of file, even if over 4GB.

For some discussion of this see:

http://groups.google.com/group/modwsgi/browse_frm/thread/5fbf3248a17cf4

Original comment by Graham.Dumpleton@gmail.com on 30 Apr 2009 at 12:06

GoogleCodeExporter commented 9 years ago
I'm using HTTP HEAD command to get a filesize of a dynamic object. Response 
Content-
Length returns the object size. 

HEAD command doesn't return data actually, can we skip the check at the HEAD 
command?

Original comment by miniway on 17 Nov 2009 at 8:22

GoogleCodeExporter commented 9 years ago
miniway, why are you asking about HEAD against this issue? Bring up this issue 
on the mod_wsgi mailing list, but 
you will need to provide more details as don't know exactly what you are 
talking about. Do make sure you read:

http://blog.dscpl.com.au/2009/10/wsgi-issues-with-http-head-requests.html

Web applications should ALWAY return data for a HEAD request. Not doing so can 
cause middleware or Apache 
output filters to fail.

Original comment by Graham.Dumpleton@gmail.com on 17 Nov 2009 at 10:11

GoogleCodeExporter commented 9 years ago
Closing out old issue. There could well still be issues lurking that don't know 
of, but not had specific complaints.

Original comment by Graham.Dumpleton@gmail.com on 12 Nov 2014 at 10:52