From 7ad4c9066ec18a11afc0f9849373b1cae6e70aff Mon Sep 17 00:00:00 2001 From: Futaura Date: Thu, 20 Jul 2023 18:07:49 +0100 Subject: [PATCH] cfilters: rename close/connect functions to avoid clashes Rename `close` and `connect` in `struct Curl_cftype` for consistency and to avoid clashes with macros of the same name (the standard AmigaOS networking connect() function is implemented via a macro). Closes #11491 --- lib/cf-h1-proxy.c | 4 ++-- lib/cf-haproxy.c | 4 ++-- lib/cf-https-connect.c | 2 +- lib/cfilters.c | 10 +++++----- lib/cfilters.h | 4 ++-- lib/connect.c | 4 ++-- lib/http_proxy.c | 4 ++-- lib/socks.c | 4 ++-- lib/vtls/vtls.c | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 319606954f..c9b157c9bc 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -1074,7 +1074,7 @@ static CURLcode cf_h1_proxy_connect(struct Curl_cfilter *cf, } DEBUGF(LOG_CF(data, cf, "connect")); - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -1146,7 +1146,7 @@ static void cf_h1_proxy_close(struct Curl_cfilter *cf, h1_tunnel_go_state(cf, cf->ctx, H1_TUNNEL_INIT, data); } if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } diff --git a/lib/cf-haproxy.c b/lib/cf-haproxy.c index 97bd5fa580..ec0100ca9e 100644 --- a/lib/cf-haproxy.c +++ b/lib/cf-haproxy.c @@ -115,7 +115,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, return CURLE_OK; } - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -168,7 +168,7 @@ static void cf_haproxy_close(struct Curl_cfilter *cf, cf->connected = FALSE; cf_haproxy_ctx_reset(cf->ctx); if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } static int cf_haproxy_get_select_socks(struct Curl_cfilter *cf, diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index d38daf0356..4e4d4b117d 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -432,7 +432,7 @@ static void cf_hc_close(struct Curl_cfilter *cf, struct Curl_easy *data) cf->connected = FALSE; if(cf->next) { - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); Curl_conn_cf_discard_chain(&cf->next, data); } } diff --git a/lib/cfilters.c b/lib/cfilters.c index b5621f7a3c..216d0b4f68 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -50,7 +50,7 @@ void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data) { cf->connected = FALSE; if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } #endif @@ -161,7 +161,7 @@ void Curl_conn_close(struct Curl_easy *data, int index) /* it is valid to call that without filters being present */ cf = data->conn->cfilter[index]; if(cf) { - cf->cft->close(cf, data); + cf->cft->do_close(cf, data); } } @@ -293,14 +293,14 @@ CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, bool blocking, bool *done) { if(cf) - return cf->cft->connect(cf, data, blocking, done); + return cf->cft->do_connect(cf, data, blocking, done); return CURLE_FAILED_INIT; } void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) { if(cf) - cf->cft->close(cf, data); + cf->cft->do_close(cf, data); } int Curl_conn_cf_get_select_socks(struct Curl_cfilter *cf, @@ -348,7 +348,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, *done = cf->connected; if(!*done) { - result = cf->cft->connect(cf, data, blocking, done); + result = cf->cft->do_connect(cf, data, blocking, done); if(!result && *done) { Curl_conn_ev_update_info(data, data->conn); conn_report_connect_stats(data, data->conn); diff --git a/lib/cfilters.h b/lib/cfilters.h index 70dcbe758e..2c65264d98 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -168,8 +168,8 @@ struct Curl_cftype { int flags; /* flags of filter type */ int log_level; /* log level for such filters */ Curl_cft_destroy_this *destroy; /* destroy resources of this cf */ - Curl_cft_connect *connect; /* establish connection */ - Curl_cft_close *close; /* close conn */ + Curl_cft_connect *do_connect; /* establish connection */ + Curl_cft_close *do_close; /* close conn */ Curl_cft_get_host *get_host; /* host filter talks to */ Curl_cft_get_select_socks *get_select_socks;/* sockets to select on */ Curl_cft_data_pending *has_data_pending;/* conn has data pending */ diff --git a/lib/connect.c b/lib/connect.c index ebb2be9f44..dc93533f6c 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -937,7 +937,7 @@ static void cf_he_close(struct Curl_cfilter *cf, ctx->state = SCFST_INIT; if(cf->next) { - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); Curl_conn_cf_discard_chain(&cf->next, data); } } @@ -1291,7 +1291,7 @@ static void cf_setup_close(struct Curl_cfilter *cf, ctx->state = CF_SETUP_INIT; if(cf->next) { - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); Curl_conn_cf_discard_chain(&cf->next, data); } } diff --git a/lib/http_proxy.c b/lib/http_proxy.c index add376ba4f..4fd998a0c3 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -71,7 +71,7 @@ static CURLcode http_proxy_cf_connect(struct Curl_cfilter *cf, DEBUGF(LOG_CF(data, cf, "connect")); connect_sub: - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -181,7 +181,7 @@ static void http_proxy_cf_close(struct Curl_cfilter *cf, ctx->cf_protocol = NULL; } if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } diff --git a/lib/socks.c b/lib/socks.c index 25a3578fac..2b3aa079d6 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -1115,7 +1115,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, return CURLE_OK; } - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -1193,7 +1193,7 @@ static void socks_proxy_cf_close(struct Curl_cfilter *cf, DEBUGASSERT(cf->next); cf->connected = FALSE; socks_proxy_cf_free(cf); - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } static void socks_proxy_cf_destroy(struct Curl_cfilter *cf, diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index fc35697a53..510bcfea20 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1504,7 +1504,7 @@ static void ssl_cf_close(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); cf_close(cf, data); - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); CF_DATA_RESTORE(cf, save); } @@ -1528,7 +1528,7 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, DEBUGASSERT(connssl); DEBUGASSERT(cf->conn->host.name); - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) goto out;