cf-socket: store errno from do_connect in ctx->error

This fixes a misleading log in verbose mode when ipv6 connectivity isn't
available, presumably also in other cases:

```
* Immediate connect fail for 2a00:1450:4028:806::200e: Network is unreachable
* connect to 2a00:1450:4028:806::200e port 443 from :: port 0 failed: Success
```

Closes #21914
This commit is contained in:
Yedaya Katsman 2026-06-08 22:48:45 +03:00 committed by Daniel Stenberg
parent e66b81a532
commit feb609f28b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1319,6 +1319,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf,
CURL_TRC_CF(data, cf, "local address %s port %d...",
ctx->ip.local_ip, ctx->ip.local_port);
if(rc == -1) {
ctx->error = error;
result = socket_connect_result(data, ctx->ip.remote_ip, error);
goto out;
}