From: Andrew M. Kuchling Date: Wed, 12 Mar 2003 14:11:00 +0000 (+0000) Subject: [Backport patch #649762] Fix for asynchat endless loop X-Git-Tag: v2.2.3c1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae77a606a54b59e897b2e1d7839934c2c549c35b;p=thirdparty%2FPython%2Fcpython.git [Backport patch #649762] Fix for asynchat endless loop When the null string is used as the terminator, it used to be the same as None, meaning "collect all the data". In the current code, however, it falls into an endless loop; this change reverts to the old behavior. --- diff --git a/Lib/asynchat.py b/Lib/asynchat.py index 1f9fc6839be6..72a212a86419 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -94,7 +94,7 @@ class async_chat (asyncore.dispatcher): while self.ac_in_buffer: lb = len(self.ac_in_buffer) terminator = self.get_terminator() - if terminator is None: + if terminator is None or terminator == '': # no terminator, collect it all self.collect_incoming_data (self.ac_in_buffer) self.ac_in_buffer = ''