QUIC: Implement SSL_has_pending
[openssl.git] / ssl / ssl_lib.c
index cad4e5f68774d915fd9d1e519cd05db907329fec..948501a56b2d58a6249506b3be7d19e4425cd97b 100644 (file)
@@ -1872,6 +1872,10 @@ int SSL_pending(const SSL *s)
 
 int SSL_has_pending(const SSL *s)
 {
+#ifndef OPENSSL_NO_QUIC
+    const QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s);
+#endif
+
     /*
      * Similar to SSL_pending() but returns a 1 to indicate that we have
      * processed or unprocessed data available or 0 otherwise (as opposed to the
@@ -1889,6 +1893,11 @@ int SSL_has_pending(const SSL *s)
 
     sc = SSL_CONNECTION_FROM_CONST_SSL(s);
 
+#ifndef OPENSSL_NO_QUIC
+    if (qc != NULL)
+        return ossl_quic_has_pending(qc);
+#endif
+
     /* Check buffered app data if any first */
     if (SSL_CONNECTION_IS_DTLS(sc)) {
         TLS_RECORD *rdata;