From: Daniel Stenberg Date: Sat, 26 Oct 2024 21:38:38 +0000 (+0200) Subject: lib: remove Curl_ prefix from static functions X-Git-Tag: curl-8_11_0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=522c89a134b84de10501ce866865b287df87adc0;p=thirdparty%2Fcurl.git lib: remove Curl_ prefix from static functions 'Curl_' is a prefix used for library global functions (cross-files). Static functions should thus not use it. Closes #15419 --- diff --git a/lib/http2.c b/lib/http2.c index e98b64e8ea..f1ee0cf9ec 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -2810,8 +2810,8 @@ out: return result; } -static bool Curl_cf_is_http2(struct Curl_cfilter *cf, - const struct Curl_easy *data) +static bool cf_is_http2(struct Curl_cfilter *cf, + const struct Curl_easy *data) { (void)data; for(; cf; cf = cf->next) { @@ -2827,7 +2827,7 @@ bool Curl_conn_is_http2(const struct Curl_easy *data, const struct connectdata *conn, int sockindex) { - return conn ? Curl_cf_is_http2(conn->cfilter[sockindex], data) : FALSE; + return conn ? cf_is_http2(conn->cfilter[sockindex], data) : FALSE; } bool Curl_http2_may_switch(struct Curl_easy *data, @@ -2879,7 +2879,7 @@ CURLcode Curl_http2_switch_at(struct Curl_cfilter *cf, struct Curl_easy *data) struct Curl_cfilter *cf_h2; CURLcode result; - DEBUGASSERT(!Curl_cf_is_http2(cf, data)); + DEBUGASSERT(!cf_is_http2(cf, data)); result = http2_cfilter_insert_after(cf, data, FALSE); if(result) diff --git a/lib/multi.c b/lib/multi.c index eb98e3f82d..5513eb3c57 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -99,8 +99,8 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, long *timeout_ms); static void process_pending_handles(struct Curl_multi *multi); static void multi_xfer_bufs_free(struct Curl_multi *multi); -static void Curl_expire_ex(struct Curl_easy *data, const struct curltime *nowp, - timediff_t milli, expire_id id); +static void expire_ex(struct Curl_easy *data, const struct curltime *nowp, + timediff_t milli, expire_id id); #if defined( DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) static const char * const multi_statename[]={ @@ -3527,7 +3527,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi, else { /* Expire with out current now, so we will get it below when * asking the splaytree for expired transfers. */ - Curl_expire_ex(data, &mrc.now, 0, EXPIRE_RUN_NOW); + expire_ex(data, &mrc.now, 0, EXPIRE_RUN_NOW); } } } @@ -3867,20 +3867,9 @@ multi_addtimeout(struct Curl_easy *data, return CURLM_OK; } -/* - * Curl_expire() - * - * given a number of milliseconds from now to use to set the 'act before - * this'-time for the transfer, to be extracted by curl_multi_timeout() - * - * The timeout will be added to a queue of timeouts if it defines a moment in - * time that is later than the current head of queue. - * - * Expire replaces a former timeout using the same id if already set. - */ -static void Curl_expire_ex(struct Curl_easy *data, - const struct curltime *nowp, - timediff_t milli, expire_id id) +static void expire_ex(struct Curl_easy *data, + const struct curltime *nowp, + timediff_t milli, expire_id id) { struct Curl_multi *multi = data->multi; struct curltime *curr_expire = &data->state.expiretime; @@ -3938,10 +3927,21 @@ static void Curl_expire_ex(struct Curl_easy *data, &data->state.timenode); } +/* + * Curl_expire() + * + * given a number of milliseconds from now to use to set the 'act before + * this'-time for the transfer, to be extracted by curl_multi_timeout() + * + * The timeout will be added to a queue of timeouts if it defines a moment in + * time that is later than the current head of queue. + * + * Expire replaces a former timeout using the same id if already set. + */ void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id id) { struct curltime now = Curl_now(); - Curl_expire_ex(data, &now, milli, id); + expire_ex(data, &now, milli, id); } /* diff --git a/lib/transfer.c b/lib/transfer.c index f9cdbc18ab..d7d3d16f3e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -204,10 +204,10 @@ CURLcode Curl_xfer_send_shutdown(struct Curl_easy *data, bool *done) * @param err error code in case of -1 return * @return number of bytes read or -1 for error */ -static ssize_t Curl_xfer_recv_resp(struct Curl_easy *data, - char *buf, size_t blen, - bool eos_reliable, - CURLcode *err) +static ssize_t xfer_recv_resp(struct Curl_easy *data, + char *buf, size_t blen, + bool eos_reliable, + CURLcode *err) { ssize_t nread; @@ -302,8 +302,7 @@ static CURLcode sendrecv_dl(struct Curl_easy *data, bytestoread = (size_t)data->set.max_recv_speed; } - nread = Curl_xfer_recv_resp(data, buf, bytestoread, - is_multiplex, &result); + nread = xfer_recv_resp(data, buf, bytestoread, is_multiplex, &result); if(nread < 0) { if(CURLE_AGAIN != result) goto out; /* real error */ diff --git a/lib/url.c b/lib/url.c index 1a1bfd2ecd..68e96136a6 100644 --- a/lib/url.c +++ b/lib/url.c @@ -651,13 +651,13 @@ bool Curl_on_disconnect(struct Curl_easy *data, } /* - * Curl_xfer_may_multiplex() + * xfer_may_multiplex() * * Return a TRUE, iff the transfer can be done over an (appropriate) * multiplexed connection. */ -static bool Curl_xfer_may_multiplex(const struct Curl_easy *data, - const struct connectdata *conn) +static bool xfer_may_multiplex(const struct Curl_easy *data, + const struct connectdata *conn) { /* If an HTTP protocol and multiplexing is enabled */ if((conn->handler->protocol & PROTO_FAMILY_HTTP) && @@ -1248,7 +1248,7 @@ ConnectionExists(struct Curl_easy *data, memset(&match, 0, sizeof(match)); match.data = data; match.needle = needle; - match.may_multiplex = Curl_xfer_may_multiplex(data, needle); + match.may_multiplex = xfer_may_multiplex(data, needle); #ifdef USE_NTLM match.want_ntlm_http = ((data->state.authhost.want & CURLAUTH_NTLM) && diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index 5afe23ee22..580e5707a8 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -76,11 +76,11 @@ static void keylog_callback(const WOLFSSL *ssl, const char *line) } #endif -static CURLcode Curl_wssl_init_ctx(struct curl_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data, - Curl_vquic_tls_ctx_setup *cb_setup, - void *cb_user_data) +static CURLcode wssl_init_ctx(struct curl_tls_ctx *ctx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + Curl_vquic_tls_ctx_setup *cb_setup, + void *cb_user_data) { struct ssl_primary_config *conn_config; CURLcode result = CURLE_FAILED_INIT; @@ -194,12 +194,12 @@ out: /** SSL callbacks ***/ -static CURLcode Curl_wssl_init_ssl(struct curl_tls_ctx *ctx, - struct Curl_cfilter *cf, - struct Curl_easy *data, - struct ssl_peer *peer, - const char *alpn, size_t alpn_len, - void *user_data) +static CURLcode wssl_init_ssl(struct curl_tls_ctx *ctx, + struct Curl_cfilter *cf, + struct Curl_easy *data, + struct ssl_peer *peer, + const char *alpn, size_t alpn_len, + void *user_data) { struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); @@ -249,12 +249,11 @@ CURLcode Curl_vquic_tls_init(struct curl_tls_ctx *ctx, (const unsigned char *)alpn, alpn_len, NULL, cb_setup, cb_user_data, ssl_user_data); #elif defined(USE_WOLFSSL) - result = Curl_wssl_init_ctx(ctx, cf, data, cb_setup, cb_user_data); + result = wssl_init_ctx(ctx, cf, data, cb_setup, cb_user_data); if(result) return result; - return Curl_wssl_init_ssl(ctx, cf, data, peer, alpn, alpn_len, - ssl_user_data); + return wssl_init_ssl(ctx, cf, data, peer, alpn, alpn_len, ssl_user_data); #else #error "no TLS lib in used, should not happen" return CURLE_FAILED_INIT; diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 2a9922b744..55c7141169 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -259,7 +259,7 @@ static bool clone_ssl_primary_config(struct ssl_primary_config *source, return TRUE; } -static void Curl_free_primary_ssl_config(struct ssl_primary_config *sslc) +static void free_primary_ssl_config(struct ssl_primary_config *sslc) { Curl_safefree(sslc->CApath); Curl_safefree(sslc->CAfile); @@ -359,9 +359,9 @@ CURLcode Curl_ssl_conn_config_init(struct Curl_easy *data, void Curl_ssl_conn_config_cleanup(struct connectdata *conn) { - Curl_free_primary_ssl_config(&conn->ssl_config); + free_primary_ssl_config(&conn->ssl_config); #ifndef CURL_DISABLE_PROXY - Curl_free_primary_ssl_config(&conn->proxy_ssl_config); + free_primary_ssl_config(&conn->proxy_ssl_config); #endif } @@ -609,7 +609,7 @@ void Curl_ssl_kill_session(struct Curl_ssl_session *session) session->sessionid_free = NULL; session->age = 0; /* fresh */ - Curl_free_primary_ssl_config(&session->ssl_config); + free_primary_ssl_config(&session->ssl_config); Curl_safefree(session->name); Curl_safefree(session->conn_to_host); @@ -726,7 +726,7 @@ CURLcode Curl_ssl_set_sessionid(struct Curl_cfilter *cf, /* now init the session struct wisely */ if(!clone_ssl_primary_config(conn_config, &store->ssl_config)) { - Curl_free_primary_ssl_config(&store->ssl_config); + free_primary_ssl_config(&store->ssl_config); store->sessionid = NULL; /* let caller free sessionid */ goto out; }