[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.
This commit is contained in:
Andrew M. Kuchling 2003-03-10 15:16:54 +00:00
parent 5b8c69f11e
commit a416341b30
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ class async_chat (asyncore.dispatcher):
while self.ac_in_buffer: while self.ac_in_buffer:
lb = len(self.ac_in_buffer) lb = len(self.ac_in_buffer)
terminator = self.get_terminator() terminator = self.get_terminator()
if terminator is None: if terminator is None or terminator == '':
# no terminator, collect it all # no terminator, collect it all
self.collect_incoming_data (self.ac_in_buffer) self.collect_incoming_data (self.ac_in_buffer)
self.ac_in_buffer = '' self.ac_in_buffer = ''