issue #139: core: Side.write(): let the OS write as much as possible.
There is no penalty for just passing as much data to the OS as possible, it is not copied, and for a non-blocking socket, the OS will just keep buffer as much as it can and tell us how much that was. Also avoids a rather pointless string slice.
This commit is contained in:
parent
49db4125d0
commit
ba9a06d0f5
|
@ -664,7 +664,7 @@ class Side(object):
|
|||
if self.fd is None:
|
||||
return None
|
||||
|
||||
written, disconnected = io_op(os.write, self.fd, s[:CHUNK_SIZE])
|
||||
written, disconnected = io_op(os.write, self.fd, s)
|
||||
if disconnected:
|
||||
return None
|
||||
return written
|
||||
|
|
Loading…
Reference in New Issue