fix send method not noticing when partial sends happen
This commit is contained in:
parent
1296a8d77e
commit
0402dd18cb
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue