diff options
author | cce <devnull@localhost> | 2007-03-21 21:51:24 +0000 |
---|---|---|
committer | cce <devnull@localhost> | 2007-03-21 21:51:24 +0000 |
commit | b31fbe9670ebb79abcf2c4717778e80ce93bc4f7 (patch) | |
tree | 5b09036eafbba562e69da737b63153e534f5720d /paste/httpserver.py | |
parent | 8b693dacf8777548af3cc6f6613ca39d7f3c137c (diff) | |
download | paste-b31fbe9670ebb79abcf2c4717778e80ce93bc4f7.tar.gz |
I think one meant min, not max here; if the read function asked
for 16 bytes, and 64 are available, you should only return 16,
not 64. This is important due to MIME types (where sub-chunks
are read in via content-length on each sub-item).
Diffstat (limited to 'paste/httpserver.py')
-rwxr-xr-x | paste/httpserver.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py index 8f70cc4..7d12e61 100755 --- a/paste/httpserver.py +++ b/paste/httpserver.py @@ -436,7 +436,8 @@ class LimitedLengthFile(object): if length is None: length = left else: - length = max(length, left) + length = min(length, left) + # next two lines are hnecessary only if read(0) blocks if not left: return '' data = self.file.read(length) |