From: Omri Bahumi Date: Wed, 27 Feb 2013 22:11:32 +0000 (+0200) Subject: Flushing the buffer when calling IOStream.read_until_close() X-Git-Tag: v3.0.0~83^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4de9ab87f24558cc7c2c463b20ef75178fd18257;p=thirdparty%2Ftornado.git Flushing the buffer when calling IOStream.read_until_close() Ran into this when calling IOStream.read_until_close() after calling IOStream.read_until("\r\n"), leaving data in the buffer. --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 86cd68a89..9d9fb7156 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -174,6 +174,7 @@ class BaseIOStream(object): return self._read_until_close = True self._streaming_callback = stack_context.wrap(streaming_callback) + self._read_from_buffer() self._add_io_state(self.io_loop.READ) def write(self, data, callback=None):