Fix: update next_net_seq_num after sending header
[lttng-tools.git] / src / common / consumer.c
index 27dfe32b8592487e6c5e881604a650085240f536..15fc9b09f800d6225be465b0d3c993e69a279f09 100644 (file)
@@ -755,7 +755,7 @@ static int write_relayd_stream_header(struct lttng_consumer_stream *stream,
                 * this next value, 1 should always be substracted in order to compare
                 * the last seen sequence number on the relayd side to the last sent.
                 */
-               data_hdr.net_seq_num = htobe64(stream->next_net_seq_num++);
+               data_hdr.net_seq_num = htobe64(stream->next_net_seq_num);
                /* Other fields are zeroed previously */
 
                ret = relayd_send_data_hdr(&relayd->data_sock, &data_hdr,
@@ -764,6 +764,8 @@ static int write_relayd_stream_header(struct lttng_consumer_stream *stream,
                        goto error;
                }
 
+               ++stream->next_net_seq_num;
+
                /* Set to go on data socket */
                outfd = relayd->data_sock.fd;
        }
@@ -2155,7 +2157,7 @@ restart:
                                        if (stream == NULL) {
                                                /* Check for deleted streams. */
                                                validate_endpoint_status_metadata_stream(&events);
-                                               continue;
+                                               goto restart;
                                        }
 
                                        DBG("Adding metadata stream %d to poll set",
This page took 0.023635 seconds and 4 git commands to generate.