mirror of
https://github.com/python/cpython.git
synced 2025-09-20 15:40:32 +00:00
fix send method not noticing when partial sends happen
This commit is contained in:
parent
1296a8d77e
commit
0402dd18cb
1 changed files with 7 additions and 1 deletions
|
@ -222,7 +222,13 @@ class IMAP4:
|
||||||
|
|
||||||
def send(self, data):
|
def send(self, data):
|
||||||
"""Send data to remote."""
|
"""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):
|
def shutdown(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue