From b31fbe9670ebb79abcf2c4717778e80ce93bc4f7 Mon Sep 17 00:00:00 2001 From: cce Date: Wed, 21 Mar 2007 21:51:24 +0000 Subject: 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). --- paste/httpserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'paste/httpserver.py') 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) -- cgit v1.2.1