mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
connectdata: remove primary+secondary ip_quadruple
Since the content varies during connection setup and while doing it (eyeballing), remove these strcut from `connectdata` and replace use with querying the connection filters. Those keep that information already. Change the info logging of established connections to also give the local address and port. Closes #17960
This commit is contained in:
parent
450c00f983
commit
83da4d9d3b
13 changed files with 152 additions and 125 deletions
16
lib/ldap.c
16
lib/ldap.c
|
|
@ -335,6 +335,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
|
|||
#endif
|
||||
char *user = NULL;
|
||||
char *passwd = NULL;
|
||||
struct ip_quadruple ipquad;
|
||||
bool is_ipv6;
|
||||
|
||||
*done = TRUE; /* unconditionally */
|
||||
infof(data, "LDAP local: LDAP Vendor = %s ; LDAP Version = %d",
|
||||
|
|
@ -352,6 +354,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
|
|||
goto quit;
|
||||
}
|
||||
|
||||
result = Curl_conn_get_ip_info(data, conn, FIRSTSOCKET, &is_ipv6, &ipquad);
|
||||
if(result)
|
||||
goto quit;
|
||||
|
||||
/* Get the URL scheme (either ldap or ldaps) */
|
||||
if(Curl_conn_is_ssl(conn, FIRSTSOCKET))
|
||||
ldap_ssl = 1;
|
||||
|
|
@ -383,7 +389,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
|
|||
#ifdef HAVE_LDAP_SSL
|
||||
#ifdef USE_WIN32_LDAP
|
||||
/* Win32 LDAP SDK does not support insecure mode without CA! */
|
||||
server = ldap_sslinit(host, (curl_ldap_num_t)conn->primary.remote_port, 1);
|
||||
server = ldap_sslinit(host, (curl_ldap_num_t)ipquad.remote_port, 1);
|
||||
ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON);
|
||||
#else
|
||||
int ldap_option;
|
||||
|
|
@ -422,10 +428,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
|
|||
result = CURLE_SSL_CERTPROBLEM;
|
||||
goto quit;
|
||||
}
|
||||
server = ldap_init(host, conn->primary.remote_port);
|
||||
server = ldap_init(host, ipquad.remote_port);
|
||||
if(!server) {
|
||||
failf(data, "LDAP local: Cannot connect to %s:%u",
|
||||
conn->host.dispname, conn->primary.remote_port);
|
||||
conn->host.dispname, ipquad.remote_port);
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
goto quit;
|
||||
}
|
||||
|
|
@ -465,10 +471,10 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
|
|||
goto quit;
|
||||
}
|
||||
else {
|
||||
server = ldap_init(host, (curl_ldap_num_t)conn->primary.remote_port);
|
||||
server = ldap_init(host, (curl_ldap_num_t)ipquad.remote_port);
|
||||
if(!server) {
|
||||
failf(data, "LDAP local: Cannot connect to %s:%u",
|
||||
conn->host.dispname, conn->primary.remote_port);
|
||||
conn->host.dispname, ipquad.remote_port);
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
goto quit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue