]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Revert "cf_socket_recv: don't count reading zero bytes as first byte"
authorDaniel Stenberg <daniel@haxx.se>
Mon, 22 Sep 2025 07:10:39 +0000 (09:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 24 Sep 2025 12:09:05 +0000 (14:09 +0200)
This reverts commit df60e8fe701e189e7629fd08b61950a0fb1b697a.

The "first byte" checkpoint is not strictly the first byte received, but
the sign of first traffic from the server, which a closed connection
also is.

Closes #18676

lib/cf-socket.c

index 2f0429efeae627a6f225ea6b1890e7f5055e683f..d5add9723f0d8ad8fb7e48e358164c15feac54e0 100644 (file)
@@ -1578,7 +1578,7 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
     *pnread = (size_t)nread;
 
   CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, %zu", len, result, *pnread);
-  if(!result && !ctx->got_first_byte && nread) {
+  if(!result && !ctx->got_first_byte) {
     ctx->first_byte_at = curlx_now();
     ctx->got_first_byte = TRUE;
   }