projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: use off_t type for lseek function return value to avoid overflow
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
stream.c
diff --git
a/src/bin/lttng-relayd/stream.c
b/src/bin/lttng-relayd/stream.c
index c59bb9416b1c9609ca34884cbc6126daf1295b78..e467cfa6c44e797ad65c4b741f0f2eea43aebf8c 100644
(file)
--- a/
src/bin/lttng-relayd/stream.c
+++ b/
src/bin/lttng-relayd/stream.c
@@
-86,7
+86,6
@@
struct relay_stream *stream_create(struct ctf_trace *trace,
stream = zmalloc(sizeof(struct relay_stream));
if (stream == NULL) {
PERROR("relay stream zmalloc");
stream = zmalloc(sizeof(struct relay_stream));
if (stream == NULL) {
PERROR("relay stream zmalloc");
- ret = -1;
goto error_no_alloc;
}
goto error_no_alloc;
}
@@
-345,7
+344,15
@@
void stream_put(struct relay_stream *stream)
void try_stream_close(struct relay_stream *stream)
{
void try_stream_close(struct relay_stream *stream)
{
+ bool session_aborted;
+ struct relay_session *session = stream->trace->session;
+
DBG("Trying to close stream %" PRIu64, stream->stream_handle);
DBG("Trying to close stream %" PRIu64, stream->stream_handle);
+
+ pthread_mutex_lock(&session->lock);
+ session_aborted = session->aborted;
+ pthread_mutex_unlock(&session->lock);
+
pthread_mutex_lock(&stream->lock);
/*
* Can be called concurently by connection close and reception of last
pthread_mutex_lock(&stream->lock);
/*
* Can be called concurently by connection close and reception of last
@@
-387,7
+394,8
@@
void try_stream_close(struct relay_stream *stream)
}
if (stream->last_net_seq_num != -1ULL &&
}
if (stream->last_net_seq_num != -1ULL &&
- ((int64_t) (stream->prev_seq - stream->last_net_seq_num)) < 0) {
+ ((int64_t) (stream->prev_seq - stream->last_net_seq_num)) < 0
+ && !session_aborted) {
/*
* Don't close since we still have data pending. This
* handles cases where an explicit close command has
/*
* Don't close since we still have data pending. This
* handles cases where an explicit close command has
This page took
0.023755 seconds
and
4
git commands to generate.