Skip to content

Commit

Permalink
early return on reentry in ack_packet (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthomas43 authored Dec 19, 2024
1 parent 8225ed0 commit 03ff1f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/udx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,13 +1070,17 @@ ack_packet (udx_stream_t *stream, uint32_t seq, int sack) {

if (write->bytes_acked == write->size && write->on_ack) {
write->on_ack(write, 0, sack);

// reentry from write->on_ack
if (stream->status & UDX_STREAM_DEAD) {
free(pkt);
return 2;
}
}
}

free(pkt);

if (stream->status & UDX_STREAM_DEAD) return 2; // reentry from write->on_ack

// TODO: the end condition needs work here to be more "stateless"
// ie if the remote has acked all our writes, then instead of waiting for retransmits, we should
// clear those and mark as local ended NOW.
Expand Down

0 comments on commit 03ff1f4

Please sign in to comment.