commit | 0402dd18cb025b7510760142087c97729702e23a | [log] [tgz] |
---|---|---|
author | Piers Lauder <piers@cs.su.oz.au> | Sun Oct 21 20:26:37 2001 +0000 |
committer | Piers Lauder <piers@cs.su.oz.au> | Sun Oct 21 20:26:37 2001 +0000 |
tree | d13f300161458d30ad69f933a270296ad08e124f | |
parent | 1296a8d77e6701d18090c24853cd098f12ef069a [diff] |
fix send method not noticing when partial sends happen
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 005cf16..204148b 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py
@@ -222,7 +222,13 @@ def send(self, data): """Send data to remote.""" - self.sock.send(data) + bytes = len(data) + while bytes > 0: + sent = self.sock.send(data) + if sent == bytes: + break # avoid copy + data = data[sent:] + bytes = bytes - sent def shutdown(self):