From: Jérémie Galarneau Date: Sat, 27 May 2017 15:54:30 +0000 (-0400) Subject: Optimization: remove unnecessary buffer resizes on partial recvs X-Git-Tag: v2.11.0-rc1~554 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=14fa22f89d786cf4cd9f7d4b89a4fd72e3fa9d3a;hp=14fa22f89d786cf4cd9f7d4b89a4fd72e3fa9d3a Optimization: remove unnecessary buffer resizes on partial recvs Using the dynamic buffer's size to express the current offset results in unnecessary resized and re-zeroing of areas of the buffer. The reception buffer's size is now used to express the total size of the expected incoming message. The offset can be inferred from the "bytes_left_to_receive" variable and message size. It also, arguably, makes the code simpler to follow. Signed-off-by: Jérémie Galarneau ---