enum relay_connection_status {
RELAY_CONNECTION_STATUS_OK,
- /* An error occured while processing an event on the connection. */
+ /* An error occurred while processing an event on the connection. */
RELAY_CONNECTION_STATUS_ERROR,
/* Connection closed/shutdown cleanly. */
RELAY_CONNECTION_STATUS_CLOSED,
{
int ret = 0;
ssize_t send_ret;
- struct relay_session *session;
+ struct relay_session *session = NULL;
struct lttcomm_relayd_status_session reply;
char session_name[LTTNG_NAME_MAX];
char hostname[LTTNG_HOST_NAME_MAX];
send_ret);
ret = -1;
}
-
+ if (ret < 0 && session) {
+ session_put(session);
+ }
return ret;
}
/*
* Rewind the current tracefile to the position at which the rotation
- * should have occured.
+ * should have occurred.
*/
lseek_ret = lseek(stream->stream_fd->fd,
stream->pos_after_last_complete_data_index, SEEK_SET);
rotate_pending = true;
DBG("Stream %" PRIu64 " is still rotating",
stream->stream_handle);
- } else if (stream->current_chunk_id.value < chunk_id) {
+ } else if (stream->current_chunk_id.value <= chunk_id) {
/*
* Stream closed on the consumer but still active on the
* relay.