summaryrefslogtreecommitdiff
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorPiers Lauder <piers@cs.su.oz.au>2001-10-21 20:26:37 +0000
committerPiers Lauder <piers@cs.su.oz.au>2001-10-21 20:26:37 +0000
commit943353ab628b2c67a98582a986f5a4d1104976cc (patch)
tree8eece91214a1383838d4deee3c673bf032271370 /Lib/imaplib.py
parent56964645596e04a202fa381f09fb9aa41a2f9a25 (diff)
downloadcpython-943353ab628b2c67a98582a986f5a4d1104976cc.tar.gz
fix send method not noticing when partial sends happen
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 005cf16019..204148bc8e 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):