diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2020-08-19 07:37:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-19 16:44:30 (GMT) |
commit | 7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04 (patch) | |
tree | 936c40c921e79b8eabd623181d78167188bbc810 /lib/connect.c | |
parent | 4446fda8e019a0138bec1aa2d83a720d63019ff9 (diff) | |
download | CMake-7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04.zip CMake-7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04.tar.gz CMake-7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04.tar.bz2 |
curl 2020-08-19 (9d954e49)
Code extracted from:
https://github.com/curl/curl.git
at commit 9d954e49bce3706a9a2efb119ecd05767f0f2a9e (curl-7_72_0).
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/connect.c b/lib/connect.c index 29293f0..b000b1b 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -74,7 +74,7 @@ #include "warnless.h" #include "conncache.h" #include "multihandle.h" -#include "system_win32.h" +#include "version_win32.h" #include "quic.h" #include "socks.h" @@ -934,10 +934,10 @@ CURLcode Curl_is_connected(struct connectdata *conn, return CURLE_OK; } - infof(data, "Connection failed\n"); } - else if(rc & CURL_CSELECT_ERR) + else if(rc & CURL_CSELECT_ERR) { (void)verifyconnect(conn->tempsock[i], &error); + } /* * The connection failed here, we should attempt to connect to the "next @@ -1085,8 +1085,8 @@ void Curl_sndbufset(curl_socket_t sockfd) static int detectOsState = DETECT_OS_NONE; if(detectOsState == DETECT_OS_NONE) { - if(Curl_verify_windows_version(6, 0, PLATFORM_WINNT, - VERSION_GREATER_THAN_EQUAL)) + if(curlx_verify_windows_version(6, 0, PLATFORM_WINNT, + VERSION_GREATER_THAN_EQUAL)) detectOsState = DETECT_OS_VISTA_OR_LATER; else detectOsState = DETECT_OS_PREVISTA; @@ -1363,15 +1363,15 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */ } struct connfind { - struct connectdata *tofind; - bool found; + long id_tofind; + struct connectdata *found; }; static int conn_is_conn(struct connectdata *conn, void *param) { struct connfind *f = (struct connfind *)param; - if(conn == f->tofind) { - f->found = TRUE; + if(conn->connection_id == f->id_tofind) { + f->found = conn; return 1; } return 0; @@ -1393,21 +1393,22 @@ curl_socket_t Curl_getconnectinfo(struct Curl_easy *data, * - that is associated with a multi handle, and whose connection * was detached with CURLOPT_CONNECT_ONLY */ - if(data->state.lastconnect && (data->multi_easy || data->multi)) { - struct connectdata *c = data->state.lastconnect; + if((data->state.lastconnect_id != -1) && (data->multi_easy || data->multi)) { + struct connectdata *c; struct connfind find; - find.tofind = data->state.lastconnect; - find.found = FALSE; + find.id_tofind = data->state.lastconnect_id; + find.found = NULL; Curl_conncache_foreach(data, data->multi_easy? &data->multi_easy->conn_cache: &data->multi->conn_cache, &find, conn_is_conn); if(!find.found) { - data->state.lastconnect = NULL; + data->state.lastconnect_id = -1; return CURL_SOCKET_BAD; } + c = find.found; if(connp) { /* only store this if the caller cares for it */ *connp = c; |