summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_impl.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2024-03-29 14:51:35 +0000
committerTomas Mraz <tomas@openssl.org>2024-04-10 15:47:24 +0200
commit5a13d35f243be66f6ad914aefe99fb708812dff1 (patch)
tree43be56686ed57a35d8226b466904b7e16fecd92c /ssl/quic/quic_impl.c
parentc79e0e7d4cdf407de6553d6ff9b95bae626fecd0 (diff)
Change approach to SSL_pending API
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24040)
Diffstat (limited to 'ssl/quic/quic_impl.c')
-rw-r--r--ssl/quic/quic_impl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index 62ebcd29aa..c77230a19f 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -2472,6 +2472,11 @@ static int quic_write_nonblocking_epw(QCTX *ctx, const void *buf, size_t len,
quic_post_write(xso, *written > 0, *written == len, flags,
qctx_should_autotick(ctx));
+
+ if (*written == 0)
+ /* SSL_write_ex returns 0 if it didn't read anything. */
+ return QUIC_RAISE_NORMAL_ERROR(ctx, SSL_ERROR_WANT_READ);
+
return 1;
}
@@ -2874,11 +2879,13 @@ static size_t ossl_quic_pending_int(const SSL *s, int check_channel)
}
if (check_channel)
- avail = ossl_quic_stream_recv_pending(ctx.xso->stream)
+ avail = ossl_quic_stream_recv_pending(ctx.xso->stream,
+ /*include_fin=*/1)
|| ossl_quic_channel_has_pending(ctx.qc->ch)
|| ossl_quic_channel_is_term_any(ctx.qc->ch);
else
- avail = ossl_quic_stream_recv_pending(ctx.xso->stream);
+ avail = ossl_quic_stream_recv_pending(ctx.xso->stream,
+ /*include_fin=*/0);
out:
quic_unlock(ctx.qc);