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:
David Wilson 2018-03-16 04:21:29 +05:45
parent 49db4125d0
commit ba9a06d0f5
1 changed files with 1 additions and 1 deletions

View File

@ -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