diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-10-19 13:40:44 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-10-19 13:40:44 +0200 |
commit | 6ff8982ffbab71ce74a9f84506109a87780a9bac (patch) | |
tree | 22d60332ef01da02b56b1647045e5c52ba7a41b1 /nDPIsrvd.c | |
parent | 315dc32baf722c6063c18b5a27d02037dc49ece8 (diff) |
Fixed bug which may happen if additional write buffers are empty but main write buffer not.
* may cause nDPIsrvd to hang indefinitly if no more data received from a collector
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPIsrvd.c')
-rw-r--r-- | nDPIsrvd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nDPIsrvd.c b/nDPIsrvd.c index efaf27cf2..28a989fc0 100644 --- a/nDPIsrvd.c +++ b/nDPIsrvd.c @@ -430,7 +430,13 @@ static int handle_outgoing_data(int epollfd, struct remote_desc * const remote) } if (utarray_len(additional_write_buffers) == 0) { - return del_out_event(epollfd, remote); + struct nDPIsrvd_write_buffer * const write_buffer = get_write_buffer(remote); + + if (write_buffer->buf.used == 0) { + return del_out_event(epollfd, remote); + } else { + return drain_main_buffer(remote); + } } return 0; |