summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-03-10 15:16:54 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-03-10 15:16:54 (GMT)
commita416341b3067306959397e896bd6b712501bd28c (patch)
treef251c7417f83a183a542f09ad6c0495124678e3b
parent5b8c69f11e98ec77155438d948307a419f091dc7 (diff)
downloadcpython-a416341b3067306959397e896bd6b712501bd28c.zip
cpython-a416341b3067306959397e896bd6b712501bd28c.tar.gz
cpython-a416341b3067306959397e896bd6b712501bd28c.tar.bz2
[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.
-rw-r--r--Lib/asynchat.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index 081031a..dfe5ea6 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -100,7 +100,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 = ''