Fix: inbound buffer may be set too short on partial command reception
[lttng-tools.git] / 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.02383 seconds and 4 git commands to generate.