diff options
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_impl.c | 15 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 11 |
2 files changed, 23 insertions, 3 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 48e1cf7c0e..ba6a863e38 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -1194,9 +1194,8 @@ int ossl_quic_peek(SSL *s, void *buf, size_t len, size_t *bytes_read) * SSL_pending * ----------- */ -size_t ossl_quic_pending(const SSL *s) +static size_t ossl_quic_pending_int(const QUIC_CONNECTION *qc) { - const QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_CONST_SSL(s); size_t avail = 0; int fin = 0; @@ -1213,6 +1212,18 @@ size_t ossl_quic_pending(const SSL *s) return avail; } +size_t ossl_quic_pending(const SSL *s) +{ + const QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_CONST_SSL(s); + + return ossl_quic_pending_int(qc); +} + +int ossl_quic_has_pending(const QUIC_CONNECTION *qc) +{ + return ossl_quic_pending_int(qc) > 0; +} + /* * SSL_stream_conclude * ------------------- diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 1b2c527eb0..83510b367a 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1829,7 +1829,16 @@ int SSL_has_pending(const SSL *s) * That data may not result in any application data, or we may fail to parse * the records for some reason. */ - const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); + const SSL_CONNECTION *sc; +#ifndef OPENSSL_NO_QUIC + const QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_CONST_SSL(s); + + if (qc != NULL) + return ossl_quic_has_pending(qc); +#endif + + + sc = SSL_CONNECTION_FROM_CONST_SSL(s); /* Check buffered app data if any first */ if (SSL_CONNECTION_IS_DTLS(sc)) { |