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:31:45 +0000 (18:31 -0400)
commit0dafcd63264e800964ecdc91eabeb366486ff121
treef7539778cc4cbb55247f4e86186cd050750ba127
parent5dafeeaa324690afac7c81ab7583523c907f2483
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.026321 seconds and 5 git commands to generate.