Skip to content

Commit

Permalink
do not close the stream if a state write is pending and no err (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh authored May 10, 2024
1 parent 4deb65f commit b3517b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/udx.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,8 @@ close_maybe (udx_stream_t *stream, int err) {
if ((stream->status & UDX_STREAM_ALL_ENDED) != UDX_STREAM_ALL_ENDED && !(stream->status & UDX_STREAM_ALL_DESTROYED)) return 0;
// if we already destroyed, bail.
if (stream->status & UDX_STREAM_CLOSED) return 0;
// do not close if no error and we have a STATE queued
if (err == 0 && stream->write_wanted & UDX_STREAM_WRITE_WANT_STATE) return 0;

stream->status |= UDX_STREAM_CLOSED;
stream->status &= ~UDX_STREAM_CONNECTED;
Expand Down

0 comments on commit b3517b4

Please sign in to comment.