The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715.

Replaces calls to socket.send() (which isn't guaranteed to send all data)
with the new socket.sendall() method.
This commit is contained in:
Martin v. Löwis 2002-02-16 23:06:19 +00:00
parent 976ade691c
commit e12454f44a
9 changed files with 15 additions and 24 deletions

View file

@ -222,14 +222,7 @@ class IMAP4:
def send(self, data):
"""Send data to remote."""
bytes = len(data)
while bytes > 0:
sent = self.sock.send(data)
if sent == bytes:
break # avoid copy
data = data[sent:]
bytes = bytes - sent
self.sock.sendall(data)
def shutdown(self):
"""Close I/O established in "open"."""