From 4818326bcafdcf55504dad3d7e5c552e25a922b7 Mon Sep 17 00:00:00 2001 From: jthomas43 <129407891+jthomas43@users.noreply.github.com> Date: Thu, 5 Dec 2024 05:35:31 -0500 Subject: [PATCH] check for stream being closed after ack_packet on receive path (#228) --- src/udx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/udx.c b/src/udx.c index 8557d66..c7bf255 100644 --- a/src/udx.c +++ b/src/udx.c @@ -1256,6 +1256,10 @@ process_packet (udx_socket_t *socket, char *buf, ssize_t buf_len, struct sockadd delivered = process_sacks(stream, buf, header_len); } + if (stream->status & UDX_STREAM_DEAD) { + return 1; + } + // Done with header processing now. // For future compat, make sure we are now pointing at the actual data using the data_offset if (data_offset) { @@ -1383,6 +1387,10 @@ process_packet (udx_socket_t *socket, char *buf, ssize_t buf_len, struct sockadd // TODO: make this work as well, if the ack packet is lost, ie // have some internal (capped) queue of "gracefully closed" streams (TIME_WAIT) + if (stream->status & UDX_STREAM_DEAD) { + return 1; + } + if ((stream->status & UDX_STREAM_ALL_ENDED) == UDX_STREAM_ALL_ENDED) { close_stream(stream, 0); return 1;