summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/imaplib.py8
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):