mirror of
https://github.com/curl/curl.git
synced 2026-07-28 09:13:07 +03:00
CURLINFO_USED_PROXY: return bool whether the proxy was used
Adds test536 to verify Closes #12719
This commit is contained in:
parent
d5b0fee39a
commit
cc04c73677
12 changed files with 259 additions and 4 deletions
|
|
@ -158,6 +158,13 @@ void Curl_persistconninfo(struct Curl_easy *data, struct connectdata *conn,
|
|||
data->info.conn_primary_port = conn->port;
|
||||
data->info.conn_remote_port = conn->remote_port;
|
||||
data->info.conn_local_port = local_port;
|
||||
data->info.used_proxy =
|
||||
#ifdef CURL_DISABLE_PROXY
|
||||
0
|
||||
#else
|
||||
conn->bits.proxy
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
static const struct Curl_addrinfo *
|
||||
|
|
|
|||
|
|
@ -180,7 +180,6 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
|
|||
*param_charp = NULL;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
return CURLE_UNKNOWN_OPTION;
|
||||
}
|
||||
|
|
@ -334,6 +333,15 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
|
|||
case CURLINFO_PROTOCOL:
|
||||
*param_longp = data->info.conn_protocol;
|
||||
break;
|
||||
case CURLINFO_USED_PROXY:
|
||||
*param_longp =
|
||||
#ifdef CURL_DISABLE_PROXY
|
||||
0
|
||||
#else
|
||||
data->info.used_proxy
|
||||
#endif
|
||||
;
|
||||
break;
|
||||
default:
|
||||
return CURLE_UNKNOWN_OPTION;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1167,6 +1167,7 @@ struct PureInfo {
|
|||
CURLproxycode pxcode;
|
||||
BIT(timecond); /* set to TRUE if the time condition didn't match, which
|
||||
thus made the document NOT get fetched */
|
||||
BIT(used_proxy); /* the transfer used a proxy */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue