]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLINFO_NUM_CONNECTS: improve accuracy
authorDaniel Stenberg <daniel@haxx.se>
Sun, 22 Mar 2020 10:49:16 +0000 (11:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 22 Mar 2020 22:31:36 +0000 (23:31 +0100)
The counter was not bumped in all cases correctly.

Reported-by: Marcel Raad
Ref: #5131
Closes #5135

lib/connect.c

index 5e631baa977d0af82716fdf647494595a26cd787..8cfdbf3af16eb85af49128036815dfd43b9611bb 100644 (file)
@@ -807,6 +807,7 @@ static void post_SOCKS(struct connectdata *conn,
     Curl_pgrsTime(conn->data, TIMER_CONNECT); /* connect done */
   Curl_updateconninfo(conn, conn->sock[sockindex]);
   Curl_verboseconnect(conn);
+  conn->data->info.numconnects++; /* to track the number of connections made */
 }
 
 /*
@@ -1343,7 +1344,6 @@ CURLcode Curl_connecthost(struct connectdata *conn,  /* context */
   if(result)
     return result;
 
-  data->info.numconnects++; /* to track the number of connections made */
   Curl_expire(conn->data, data->set.happy_eyeballs_timeout,
               EXPIRE_HAPPY_EYEBALLS);