diff options
author | Piers Lauder <piers@cs.su.oz.au> | 2001-10-21 20:26:37 (GMT) |
---|---|---|
committer | Piers Lauder <piers@cs.su.oz.au> | 2001-10-21 20:26:37 (GMT) |
commit | 0402dd18cb025b7510760142087c97729702e23a (patch) | |
tree | d13f300161458d30ad69f933a270296ad08e124f /Lib/imaplib.py | |
parent | 1296a8d77e6701d18090c24853cd098f12ef069a (diff) | |
download | cpython-0402dd18cb025b7510760142087c97729702e23a.zip cpython-0402dd18cb025b7510760142087c97729702e23a.tar.gz cpython-0402dd18cb025b7510760142087c97729702e23a.tar.bz2 |
fix send method not noticing when partial sends happen
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r-- | Lib/imaplib.py | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ class IMAP4: 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): |