Fix: inbound buffer may be set too short on partial command reception
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 10:17:48 +0000 (06:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 13:19:12 +0000 (09:19 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/notification-thread-events.c

index 0bb75b6d81607954093695ab894b58326a70f0bb..0fd97e4e2f1e95172f4c4cb2883d2dd627d18b95 100644 (file)
@@ -1622,9 +1622,14 @@ int handle_notification_thread_client_in(
        }
 
        offset = client->communication.inbound.buffer.size;
+       /*
+        * The buffer's size starts out at the size of the command header.
+        * Once the command is determined, the "bytes_to_receive" are bumped
+        * to fit the remainder of the message being received.
+        */
        ret = lttng_dynamic_buffer_set_size(
                        &client->communication.inbound.buffer,
-                       client->communication.inbound.bytes_to_receive);
+                       client->communication.inbound.bytes_to_receive + offset);
        if (ret) {
                goto end;
        }
This page took 0.027788 seconds and 4 git commands to generate.