From 0402dd18cb025b7510760142087c97729702e23a Mon Sep 17 00:00:00 2001 From: Piers Lauder Date: Sun, 21 Oct 2001 20:26:37 +0000 Subject: [PATCH] fix send method not noticing when partial sends happen --- Lib/imaplib.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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): -- 2.50.1