From 5b860b532ac674235540b834a865f9ea8635d74c Mon Sep 17 00:00:00 2001 From: benoitc Date: Wed, 9 Jun 2010 16:07:38 +0200 Subject: [PATCH] return all the data when reading is finished in EOFReader --- gunicorn/http/body.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/http/body.py b/gunicorn/http/body.py index 0c82c25a..fa689839 100644 --- a/gunicorn/http/body.py +++ b/gunicorn/http/body.py @@ -146,7 +146,7 @@ class EOFReader(object): raise TypeError("size must be an integral type") if size < 0: raise ValueError("Size must be positive.") - if size == 0: + if size == 0 or self.finished: return "" data = self.unreader.read() @@ -158,6 +158,7 @@ class EOFReader(object): if not data: self.finished = True + return self.buf.getvalue() data = self.buf.getvalue() ret, rest = data[:size], data[size:]