Skip to content

Commit

Permalink
Handle the case where the read buffer is empty but we have received FIN
Browse files Browse the repository at this point in the history
In some cases where a FIN has been received but with no data quic_read_actual
was failing to raise SSL_ERROR_ZERO_RETURN. This meant that we could end up
blocking in SSL_read(_ex) for too long.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #21780)
  • Loading branch information
mattcaswell authored and t8m committed Aug 20, 2023
1 parent d561fe5 commit 72622c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ssl/quic/quic_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,9 @@ static int quic_read_actual(QCTX *ctx,
stream);
}

if (*bytes_read == 0 && is_fin)
return QUIC_RAISE_NORMAL_ERROR(ctx, SSL_ERROR_ZERO_RETURN);

return 1;
}

Expand Down

0 comments on commit 72622c0

Please sign in to comment.