From ba9a06d0f51350af258c4cb439e34eae3156f2d3 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 16 Mar 2018 04:21:29 +0545 Subject: [PATCH] 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. --- mitogen/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitogen/core.py b/mitogen/core.py index 696b89ea..f70fbf76 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -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