From: David Goulet Date: Thu, 10 Jan 2013 17:07:35 +0000 (-0500) Subject: Fix: update next_net_seq_num after sending header X-Git-Tag: v2.2.0-rc1~122 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=3604f373dd93990e0fd6342cfe4c657efaa171bb;hp=3604f373dd93990e0fd6342cfe4c657efaa171bb Fix: update next_net_seq_num after sending header Increment the sequence number after we are sure that the relayd has received correctly the data header. If an error occurs when sending the header, the data won't be extracted from the buffers thus keeping this sequence number untouched. Furthermore, after sending the header, if the relayd dies, this value won't matter much and if there is an error on the stream when reading the trace data, the stream will be deleted thus closed on the relayd making this value useless. It's important to note that this sequence number is updated on the relayd side if the full expected data packet was received. So, incrementing the value after the transmission of the header is not changing anything in terms of value coherency. The point is to have a semantic of when read and used successfully (transmission to relayd), let's update it. In that code flow, the stream's lock is acquired so no need to read/update it atomically. I've also added a comments to better understand the purpose of this variable and how to use it. Acked-by: Mathieu Desnoyers Signed-off-by: David Goulet ---