Fix: close socket on protocol error, sendmsg MSG_NOSIGNAL
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Aug 2015 22:24:11 +0000 (18:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Aug 2015 22:32:01 +0000 (18:32 -0400)
commit7d60854fc6d4a4b00be6615bdfedd1237db630ef
tree3199d06d8b3b1690ac3642c4cff9f7384f713667
parent28ae8cd513ae548a8c9ab565f60b821077fc252e
Fix: close socket on protocol error, sendmsg MSG_NOSIGNAL

Don't try to keep interacting with sessiond when a protocol error is
detected at the UST application side: this means we cannot trust the
protocol anymore, so there is no reason for keeping the socket open.
For instance, if the application is exiting and we receive a new stream,
we're effectively not reading the stream data, and we return an error.
Unfortunately, the session daemon may try to send us another command,
but we will try interpreting the stream data as a command, which is
invalid.

Also, use MSG_NOSIGNAL flag in the fds recvmsg, so the session daemon
don't get killed with SIGPIPE when it cannot send to the socket due to
connection closed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-comm/lttng-ust-comm.c
liblttng-ust/lttng-ust-comm.c
This page took 0.02496 seconds and 4 git commands to generate.