]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cf-socket: Disable socket receive buffer by default
authorStefan Eissing <stefan@eissing.org>
Thu, 13 Apr 2023 15:46:52 +0000 (17:46 +0200)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 14 Apr 2023 07:15:05 +0000 (03:15 -0400)
- Disable socket receive buffer unless USE_RECV_BEFORE_SEND_WORKAROUND
  is in place.

While we would like to use the receive buffer, we have stalls in
parallel transfers where not all buffered data is consumed and no socket
events happen.

Note USE_RECV_BEFORE_SEND_WORKAROUND is a Windows sockets workaround
that has been disabled by default since b4b6e4f1, due to other bugs.

Closes https://github.com/curl/curl/pull/10961

lib/cf-socket.c

index 830daa1f5493800347c51c7a64973503ea10188e..dc6a40e906195cea98c1cee581bc9773b2d8ba83 100644 (file)
@@ -1387,11 +1387,20 @@ static void cf_socket_active(struct Curl_cfilter *cf, struct Curl_easy *data)
     conn_set_primary_ip(cf, data);
     set_local_ip(cf, data);
     Curl_persistconninfo(data, cf->conn, ctx->l_ip, ctx->l_port);
-    /* We buffer only for TCP transfers that do not install their own
-     * read function. Those may still have expectations about socket
-     * behaviours from the past. */
+    /* We buffer only for TCP transfers that do not install their own read
+     * function. Those may still have expectations about socket behaviours from
+     * the past.
+     *
+     * Note buffering is currently disabled by default because we have stalls
+     * in parallel transfers where not all buffered data is consumed and no
+     * socket events happen.
+     */
+#ifdef USE_RECV_BEFORE_SEND_WORKAROUND
     ctx->buffer_recv = (ctx->transport == TRNSPRT_TCP &&
                         (cf->conn->recv[cf->sockindex] == Curl_conn_recv));
+#else
+    ctx->buffer_recv = FALSE;
+#endif
   }
   ctx->active = TRUE;
 }