Skip to content

Commit

Permalink
check for stream being closed after ack_packet on receive path (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthomas43 authored Dec 5, 2024
1 parent b737b2d commit 4818326
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/udx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4818326

Please sign in to comment.