mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715.
Replaces calls to socket.send() (which isn't guaranteed to send all data) with the new socket.sendall() method.
This commit is contained in:
parent
976ade691c
commit
e12454f44a
9 changed files with 15 additions and 24 deletions
|
@ -269,7 +269,7 @@ class Telnet:
|
|||
if IAC in buffer:
|
||||
buffer = buffer.replace(IAC, IAC+IAC)
|
||||
self.msg("send %s", `buffer`)
|
||||
self.sock.send(buffer)
|
||||
self.sock.sendall(buffer)
|
||||
|
||||
def read_until(self, match, timeout=None):
|
||||
"""Read until a given string is encountered or until timeout.
|
||||
|
@ -411,7 +411,7 @@ class Telnet:
|
|||
if self.option_callback:
|
||||
self.option_callback(self.sock, c, opt)
|
||||
else:
|
||||
self.sock.send(IAC + WONT + opt)
|
||||
self.sock.sendall(IAC + WONT + opt)
|
||||
elif c in (WILL, WONT):
|
||||
opt = self.rawq_getchar()
|
||||
self.msg('IAC %s %d',
|
||||
|
@ -419,7 +419,7 @@ class Telnet:
|
|||
if self.option_callback:
|
||||
self.option_callback(self.sock, c, opt)
|
||||
else:
|
||||
self.sock.send(IAC + DONT + opt)
|
||||
self.sock.sendall(IAC + DONT + opt)
|
||||
else:
|
||||
self.msg('IAC %d not recognized' % ord(opt))
|
||||
except EOFError: # raised by self.rawq_getchar()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue