Fix: consumer: 64-bit index for relayd rather than 32-bit (v2)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 28 Jun 2013 15:26:04 +0000 (11:26 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 28 Jun 2013 15:43:30 +0000 (11:43 -0400)
commitda009f2c0baef56316db8087abd1867f99969374
tree496f8c744f25da29b8a0668b61bbee010c8f7f23
parent95a1109b9ea25871941d9fff87cd8c2b2cba61d3
Fix: consumer: 64-bit index for relayd rather than 32-bit (v2)

Relayd "unique" ids wrap every 32-bit, and in some cases, negative
values are considered as error.

Change this to make the error value specifically -1ULL, use a direct
comparison (since we use an unsigned 64-bit integer, comparison with 0
becomes incorrect).

Since we now use a 64-bit ID, it is assumed to _never_ wrap-around
(remember, value -1ULL is an _error_). Therefore,
consumer_add_relayd_socket() can become much more strict than it was:
instead of accepting re-use of net_seq_idx, we can now assert that upon
LTTNG_STREAM_CONTROL socket, we have indeed allocated a relayd object,
and upon LTTNG_STREAM_DATA, we have found a relayd object.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c
src/common/consumer.h
src/common/ust-consumer/ust-consumer.c
This page took 0.026059 seconds and 4 git commands to generate.