]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
transfer: fix data_pending for builds with both h2 and h3 enabled
authorDaniel Stenberg <daniel@haxx.se>
Mon, 27 Jul 2020 13:43:45 +0000 (15:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Jul 2020 21:48:49 +0000 (23:48 +0200)
Closes #5734

lib/transfer.c

index 4b923744e15d526edcff4124a1fa53cfa8c7775a..161dcfa01c1a618469039f54cc1afa9346c3a67e 100644 (file)
@@ -487,6 +487,12 @@ CURLcode Curl_readrewind(struct connectdata *conn)
 static int data_pending(const struct Curl_easy *data)
 {
   struct connectdata *conn = data->conn;
+
+#ifdef ENABLE_QUIC
+  if(conn->transport == TRNSPRT_QUIC)
+    return Curl_quic_data_pending(data);
+#endif
+
   /* in the case of libssh2, we can never be really sure that we have emptied
      its internal buffers so we MUST always try until we get EAGAIN back */
   return conn->handler->protocol&(CURLPROTO_SCP|CURLPROTO_SFTP) ||
@@ -500,8 +506,6 @@ static int data_pending(const struct Curl_easy *data)
        be called and we cannot signal the HTTP/2 stream has closed. As
        a workaround, we return nonzero here to call http2_recv. */
     ((conn->handler->protocol&PROTO_FAMILY_HTTP) && conn->httpversion >= 20);
-#elif defined(ENABLE_QUIC)
-    Curl_ssl_data_pending(conn, FIRSTSOCKET) || Curl_quic_data_pending(data);
 #else
     Curl_ssl_data_pending(conn, FIRSTSOCKET);
 #endif