]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
socks: handle error in verbose trace gracefully
authorStefan Eissing <stefan@eissing.org>
Thu, 25 Sep 2025 10:00:57 +0000 (12:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Sep 2025 14:55:22 +0000 (16:55 +0200)
Adjust the flow to always succeed in verbose trace of connect.

Reported in Joshua's sarif data

Closes #18722

lib/socks.c

index 6927e32c3ecbe98ddd979b4114e2155ede59451d..da974ad6d8d72749ad2c2ab4bad5efbb4cb1a8c8 100644 (file)
@@ -1291,15 +1291,16 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf,
   if(Curl_trc_is_verbose(data)) {
     struct ip_quadruple ipquad;
     bool is_ipv6;
-    result = Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad);
-    if(result)
-      return result;
-    infof(data, "Opened %sSOCKS connection from %s port %u to %s port %u "
-          "(via %s port %u)",
-          (sockindex == SECONDARYSOCKET) ? "2nd " : "",
-          ipquad.local_ip, ipquad.local_port,
-          sx->hostname, sx->remote_port,
-          ipquad.remote_ip, ipquad.remote_port);
+    if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad))
+      infof(data, "Opened %sSOCKS connection from %s port %u to %s port %u "
+            "(via %s port %u)",
+            (sockindex == SECONDARYSOCKET) ? "2nd " : "",
+            ipquad.local_ip, ipquad.local_port,
+            sx->hostname, sx->remote_port,
+            ipquad.remote_ip, ipquad.remote_port);
+    else
+      infof(data, "Opened %sSOCKS connection",
+            (sockindex == SECONDARYSOCKET) ? "2nd " : "");
   }
 #endif
   socks_proxy_cf_free(cf);