Commit ba9a06d0 authored by David Wilson's avatar David Wilson

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.
parent 49db4125
...@@ -664,7 +664,7 @@ class Side(object): ...@@ -664,7 +664,7 @@ class Side(object):
if self.fd is None: if self.fd is None:
return 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: if disconnected:
return None return None
return written return written
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment