mirror of
https://github.com/curl/curl.git
synced 2026-08-02 06:00:28 +03:00
setup connection filter: mark as setup
Add CF_TYPE_SETUP to the setup connection filter so that it is removed and destroyed after the connection has been established. Closes #21437
This commit is contained in:
parent
4840fe3f8a
commit
bfcc1c6eb4
2 changed files with 35 additions and 1 deletions
|
|
@ -116,6 +116,37 @@ CURLcode Curl_cf_def_query(struct Curl_cfilter *cf,
|
|||
CURLE_UNKNOWN_OPTION;
|
||||
}
|
||||
|
||||
#ifdef CURLVERBOSE
|
||||
static void conn_trc_filters(struct Curl_easy *data,
|
||||
int sockindex,
|
||||
const char *info)
|
||||
{
|
||||
if(CURL_TRC_M_is_verbose(data) && data->conn) {
|
||||
struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
|
||||
|
||||
if(cf) {
|
||||
struct dynbuf msg;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
curlx_dyn_init(&msg, 1024);
|
||||
result = curlx_dyn_addf(&msg, "%s [%d]", info, sockindex);
|
||||
for(; cf && !result; cf = cf->next) {
|
||||
result = curlx_dyn_addf(&msg, "[%s%s]",
|
||||
cf->connected ? "" : "!", cf->cft->name);
|
||||
}
|
||||
if(!result)
|
||||
CURL_TRC_M(data, "%s", curlx_dyn_ptr(&msg));
|
||||
else
|
||||
CURL_TRC_M(data, "%s [%d] error %d tracing chain",
|
||||
info, sockindex, result);
|
||||
curlx_dyn_free(&msg);
|
||||
}
|
||||
else
|
||||
CURL_TRC_M(data, "%s [%d][-]", info, sockindex);
|
||||
}
|
||||
}
|
||||
#endif /* CURLVERBOSE */
|
||||
|
||||
void Curl_conn_cf_discard_chain(struct Curl_cfilter **pcf,
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
|
|
@ -560,11 +591,14 @@ CURLcode Curl_conn_connect(struct Curl_easy *data,
|
|||
conn_report_connect_stats(cf, data);
|
||||
data->conn->keepalive = *Curl_pgrs_now(data);
|
||||
VERBOSE(result = cf_verboseconnect(data, cf));
|
||||
VERBOSE(conn_trc_filters(data, sockindex, "connected"));
|
||||
conn_remove_setup_filters(data, sockindex);
|
||||
VERBOSE(conn_trc_filters(data, sockindex, "reduced to"));
|
||||
goto out;
|
||||
}
|
||||
else if(result) {
|
||||
CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %d", result);
|
||||
VERBOSE(conn_trc_filters(data, sockindex, "failed to connect"));
|
||||
conn_report_connect_stats(cf, data);
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ static void cf_setup_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
|
|||
|
||||
struct Curl_cftype Curl_cft_setup = {
|
||||
"SETUP",
|
||||
0,
|
||||
CF_TYPE_SETUP,
|
||||
CURL_LOG_LVL_NONE,
|
||||
cf_setup_destroy,
|
||||
cf_setup_connect,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue