lib: drop, or replace sendf.h with curl_trc.h where possible

- replace `sendf.h` with `curl_trc.h` where it was included just for it.
- drop unused `curl_trc.h` includes.
- easy: delete obsolete comment about `send.h` include reason.

Also:
- move out `curl_trc.h` include from `sendf.h` and include it directly
  in users, where not done already. To flatten the include tree and
  to less rely on indirect includes.
- stop including `sendf.h` from other headers, replace it with forward
  declaration of `Curl_easy`, as done already elsewhere.

Verified with an all non-unity CI run.

Closes #20061
This commit is contained in:
Viktor Szakats 2025-12-21 02:40:10 +01:00
parent 4df7269ba8
commit e8415a8296
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
87 changed files with 82 additions and 60 deletions

View File

@ -33,7 +33,7 @@
#include "curl_fopen.h"
#include "curl_get_line.h"
#include "parsedate.h"
#include "sendf.h"
#include "curl_trc.h"
#include "curlx/inet_pton.h"
#include "curlx/strparse.h"
#include "curlx/timeval.h"

View File

@ -48,7 +48,7 @@
#include "urldata.h"
#include "cfilters.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "url.h"
#include "multiif.h"

View File

@ -46,7 +46,6 @@
#include "urldata.h"
#include "asyn.h"
#include "sendf.h"
#include "hostip.h"
#include "multiif.h"
#include "select.h"

View File

@ -56,7 +56,7 @@
#include "urldata.h"
#include "cfilters.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "url.h"
#include "multiif.h"

View File

@ -57,7 +57,7 @@
#include "urldata.h"
#include "bufq.h"
#include "sendf.h"
#include "curl_trc.h"
#include "if2ip.h"
#include "cfilters.h"
#include "cf-socket.h"

View File

@ -29,7 +29,7 @@
#include "cfilters.h"
#include "connect.h"
#include "url.h"
#include "sendf.h"
#include "curl_trc.h"
#include "progress.h"
#include "select.h"
#include "curlx/strparse.h"

View File

@ -30,7 +30,7 @@
#include "cfilters.h"
#include "progress.h"
#include "multiif.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cshutdn.h"
#include "conncache.h"
#include "curl_share.h"

View File

@ -51,7 +51,7 @@
#endif
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "strerror.h"
#include "cfilters.h"
#include "connect.h"

View File

@ -47,6 +47,7 @@
#endif
#include "sendf.h"
#include "curl_trc.h"
#include "http.h"
#include "content_encoding.h"

View File

@ -29,7 +29,7 @@
#include "urldata.h"
#include "cookie.h"
#include "psl.h"
#include "sendf.h"
#include "curl_trc.h"
#include "slist.h"
#include "curl_share.h"
#include "strcase.h"

View File

@ -31,7 +31,7 @@
#include "progress.h"
#include "multiif.h"
#include "multi_ev.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cshutdn.h"
#include "sigpipe.h"
#include "connect.h"

View File

@ -27,7 +27,7 @@
#ifdef HAVE_GSSAPI
#include "curl_gssapi.h"
#include "sendf.h"
#include "curl_trc.h"
#ifdef DEBUGBUILD
#if defined(HAVE_GSSGNU) || !defined(_WIN32)

View File

@ -44,7 +44,7 @@
#include "vauth/vauth.h"
#include "cfilters.h"
#include "curl_sasl.h"
#include "sendf.h"
#include "curl_trc.h"
/* Supported mechanisms */
static const struct {

View File

@ -28,6 +28,7 @@
#include "cfilters.h"
#include "multiif.h"
#include "sendf.h"
#include "curl_trc.h"
#include "transfer.h"
#include "cw-out.h"
#include "cw-pause.h"

View File

@ -26,7 +26,7 @@
#include "curl_setup.h"
#include "sendf.h"
struct Curl_easy;
/**
* The client writer type "cw-out" that does the actual writing to

View File

@ -28,6 +28,7 @@
#include "bufq.h"
#include "cfilters.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cw-pause.h"

View File

@ -26,7 +26,7 @@
#include "curl_setup.h"
#include "sendf.h"
struct Curl_easy;
/**
* The client writer type "cw-pause" that buffers writes for

View File

@ -54,7 +54,7 @@
#include "urldata.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "escape.h"
#include "dict.h"

View File

@ -30,7 +30,7 @@
#include "curl_addrinfo.h"
#include "doh.h"
#include "sendf.h"
#include "curl_trc.h"
#include "multiif.h"
#include "url.h"
#include "connect.h"

View File

@ -58,7 +58,8 @@
#include "multi_ev.h"
#include "select.h"
#include "cfilters.h"
#include "sendf.h" /* for failf function prototype */
#include "sendf.h"
#include "curl_trc.h"
#include "connect.h" /* for Curl_getconnectinfo */
#include "slist.h"
#include "mime.h"

View File

@ -57,6 +57,7 @@
#include "urldata.h"
#include "progress.h"
#include "sendf.h"
#include "curl_trc.h"
#include "escape.h"
#include "file.h"
#include "multiif.h"

View File

@ -32,7 +32,6 @@ struct Curl_easy;
#include "urldata.h" /* for struct Curl_easy */
#include "mime.h"
#include "sendf.h"
#include "strdup.h"
#include "bufref.h"
#include "curlx/fopen.h"

View File

@ -42,6 +42,7 @@
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "if2ip.h"
#include "hostip.h"
#include "progress.h"

View File

@ -29,6 +29,7 @@
#include "urldata.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cfilters.h"
#include "connect.h"
#include "gopher.h"

View File

@ -26,6 +26,7 @@
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "headers.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HEADERS_API)

View File

@ -45,7 +45,7 @@
#include <signal.h>
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "connect.h"
#include "hostip.h"
#include "hash.h"

View File

@ -44,7 +44,7 @@
#endif
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "url.h"

View File

@ -45,7 +45,7 @@
#include "urldata.h"
#include "cfilters.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "url.h"
#include "curlx/inet_pton.h"

View File

@ -33,7 +33,6 @@
#include "hsts.h"
#include "curl_fopen.h"
#include "curl_get_line.h"
#include "sendf.h"
#include "parsedate.h"
#include "curl_share.h"
#include "curlx/strparse.h"

View File

@ -50,6 +50,7 @@
#include "urldata.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "formdata.h"
#include "mime.h"
#include "progress.h"

View File

@ -35,6 +35,7 @@
#include "http2.h"
#include "http.h"
#include "sendf.h"
#include "curl_trc.h"
#include "select.h"
#include "curlx/base64.h"
#include "multiif.h"

View File

@ -32,7 +32,7 @@
#include "http_aws_sigv4.h"
#include "curl_sha256.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "escape.h"
#include "curlx/strparse.h"
#include "curlx/timeval.h"

View File

@ -28,7 +28,7 @@
#include "urldata.h"
#include "cfilters.h"
#include "sendf.h"
#include "curl_trc.h"
#include "http_negotiate.h"
#include "vauth/vauth.h"
#include "vtls/vtls.h"

View File

@ -34,7 +34,7 @@
*/
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "strcase.h"
#include "http_ntlm.h"
#include "curl_ntlm_core.h"

View File

@ -28,7 +28,7 @@
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY)
#include "sendf.h"
#include "curl_trc.h"
#include "http.h"
#include "url.h"
#include "cfilters.h"

View File

@ -29,7 +29,7 @@
#include "urldata.h"
#include "httpsrr.h"
#include "connect.h"
#include "sendf.h"
#include "curl_trc.h"
#include "strdup.h"
static CURLcode httpsrr_decode_alpn(const uint8_t *cp, size_t len,

View File

@ -30,7 +30,6 @@
#include "urldata.h"
#include "idn.h"
#include "sendf.h"
#ifdef USE_LIBIDN2
#include <idn2.h>

View File

@ -56,6 +56,7 @@
#include "curlx/dynbuf.h"
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "progress.h"
#include "transfer.h"

View File

@ -79,6 +79,7 @@
#include "urldata.h"
#include "cfilters.h"
#include "sendf.h"
#include "curl_trc.h"
#include "escape.h"
#include "progress.h"
#include "transfer.h"

View File

@ -29,6 +29,7 @@ struct Curl_easy;
#include "mime.h"
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "transfer.h"
#include "strdup.h"
#include "curlx/fopen.h"

View File

@ -30,6 +30,7 @@
#include "urldata.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "progress.h"
#include "mqtt.h"
#include "select.h"

View File

@ -35,6 +35,7 @@
#include "multiif.h"
#include "multi_ev.h"
#include "sendf.h"
#include "curl_trc.h"
#include "curlx/timeval.h"
#include "http.h"
#include "select.h"

View File

@ -43,6 +43,7 @@
#include "urldata.h"
#include "url.h"
#include "sendf.h"
#include "curl_trc.h"
#include "vtls/vtls.h"
#include "transfer.h"
#include "curl_ldap.h"

View File

@ -31,6 +31,7 @@
#include "cfilters.h"
#include "connect.h"
#include "sendf.h"
#include "curl_trc.h"
#include "select.h"
#include "progress.h"
#include "pingpong.h"

View File

@ -57,6 +57,7 @@
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "progress.h"
#include "transfer.h"

View File

@ -25,7 +25,7 @@
#include "curl_setup.h"
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "multiif.h"
#include "progress.h"
#include "transfer.h"

View File

@ -30,7 +30,7 @@
#include "urldata.h"
#include "vtls/vtls.h"
#include "sendf.h"
#include "curl_trc.h"
#include "curlx/timeval.h"
#include "rand.h"
#include "escape.h"

View File

@ -31,6 +31,7 @@
#include "progress.h"
#include "request.h"
#include "sendf.h"
#include "curl_trc.h"
#include "transfer.h"
#include "url.h"
#include "curlx/strparse.h"

View File

@ -29,6 +29,7 @@
#include "urldata.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "multiif.h"
#include "http.h"
#include "url.h"

View File

@ -36,6 +36,7 @@
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "transfer.h"
#include "cfilters.h"
#include "connect.h"

View File

@ -26,8 +26,6 @@
#include "curl_setup.h"
#include "curl_trc.h"
/**
* Type of data that is being written to the client (application)
* - data written can be either BODY or META data
@ -55,6 +53,7 @@
/* Forward declarations */
struct Curl_creader;
struct Curl_cwriter;
struct Curl_easy;
/**
* Write `len` bytes at `prt` to the client. `type` indicates what

View File

@ -41,7 +41,7 @@
#include "strcase.h"
#include "curl_share.h"
#include "vtls/vtls.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "http2.h"
#include "setopt.h"

View File

@ -31,6 +31,7 @@
#include "urldata.h"
#include "url.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cfilters.h"
#include "connect.h"
#include "progress.h"

View File

@ -59,6 +59,7 @@
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "hostip.h"
#include "progress.h"
#include "transfer.h"

View File

@ -35,7 +35,7 @@
#include "urldata.h"
#include "bufq.h"
#include "sendf.h"
#include "curl_trc.h"
#include "select.h"
#include "cfilters.h"
#include "connect.h"

View File

@ -29,7 +29,7 @@
#include "curl_gssapi.h"
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cfilters.h"
#include "connect.h"
#include "curlx/nonblock.h"

View File

@ -28,7 +28,7 @@
#if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_PROXY)
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
#include "cfilters.h"
#include "connect.h"
#include "strerror.h"

View File

@ -50,6 +50,7 @@
#include "url.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "telnet.h"
#include "connect.h"
#include "progress.h"

View File

@ -51,6 +51,7 @@
#include "cf-socket.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "tftp.h"
#include "progress.h"
#include "connect.h"

View File

@ -62,6 +62,7 @@
#include "cw-out.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "progress.h"
#include "http.h"
#include "url.h"

View File

@ -74,7 +74,7 @@
#include "vtls/vtls.h"
#include "hostip.h"
#include "transfer.h"
#include "sendf.h"
#include "curl_trc.h"
#include "progress.h"
#include "cookie.h"
#include "strcase.h"

View File

@ -32,7 +32,6 @@
(!defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP))
#include "vauth.h"
#include "../sendf.h"
/*
* Curl_auth_create_plain_message()

View File

@ -32,7 +32,7 @@
#include "vauth.h"
#include "digest.h"
#include "../curlx/multibyte.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../strdup.h"
#include "../strcase.h"
#include "../strerror.h"

View File

@ -29,7 +29,7 @@
#ifdef USE_GSASL
#include "vauth.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include <gsasl.h>

View File

@ -32,7 +32,7 @@
#include "vauth.h"
#include "../curl_sasl.h"
#include "../curl_gssapi.h"
#include "../sendf.h"
#include "../curl_trc.h"
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic push

View File

@ -29,7 +29,7 @@
#if defined(USE_WINDOWS_SSPI) && defined(USE_KERBEROS5)
#include "vauth.h"
#include "../sendf.h"
#include "../curl_trc.h"
/*
* Curl_auth_is_gssapi_supported()

View File

@ -36,7 +36,7 @@
#define DEBUG_ME 0
#include "vauth.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../curl_ntlm_core.h"
#include "../rand.h"
#include "../strdup.h"

View File

@ -28,7 +28,7 @@
#include "vauth.h"
#include "../curl_ntlm_core.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../strdup.h"
/*

View File

@ -31,7 +31,7 @@
#include "vauth.h"
#include "../curlx/base64.h"
#include "../curl_gssapi.h"
#include "../sendf.h"
#include "../curl_trc.h"
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic push

View File

@ -30,7 +30,7 @@
#include "vauth.h"
#include "../curlx/base64.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../strerror.h"
/*

View File

@ -49,7 +49,7 @@
#include "../urldata.h"
#include "../url.h"
#include "../uint-hash.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../rand.h"
#include "../multiif.h"
#include "../cfilters.h"

View File

@ -33,7 +33,7 @@
#include <nghttp3/nghttp3.h>
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../multiif.h"
#include "../cfilters.h"
#include "../cf-socket.h"

View File

@ -33,7 +33,7 @@
#include "../urldata.h"
#include "../cfilters.h"
#include "../cf-socket.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../rand.h"
#include "../multiif.h"
#include "../connect.h"

View File

@ -45,7 +45,6 @@
#endif
#include "../urldata.h"
#include "../curl_trc.h"
#include "../cfilters.h"
#include "../vtls/keylog.h"
#include "../vtls/vtls.h"

View File

@ -45,6 +45,7 @@
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../hostip.h"
#include "../progress.h"
#include "../transfer.h"

View File

@ -44,6 +44,7 @@
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../hostip.h"
#include "../progress.h"
#include "../transfer.h"

View File

@ -41,7 +41,7 @@
#include <nettle/sha2.h>
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "keylog.h"
#include "gtls.h"
#include "vtls.h"

View File

@ -60,7 +60,7 @@
#endif
#include "cipher_suite.h"
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "mbedtls.h"
#include "vtls.h"
#include "vtls_int.h"

View File

@ -44,7 +44,7 @@
#endif
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../formdata.h" /* for the boundary function */
#include "../url.h" /* for the ssl config check function */
#include "../curlx/inet_pton.h"

View File

@ -33,7 +33,7 @@
#include "../curlx/fopen.h"
#include "../curlx/strerr.h"
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "vtls.h"
#include "vtls_int.h"
#include "rustls.h"

View File

@ -42,7 +42,7 @@
#include "vtls.h"
#include "vtls_int.h"
#include "vtls_scache.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../connect.h" /* for the connect timeout */
#include "../strdup.h"
#include "../strerror.h"

View File

@ -43,7 +43,7 @@
#include "../curlx/inet_pton.h"
#include "vtls.h"
#include "vtls_int.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../strerror.h"
#include "../curlx/winapi.h"
#include "../curlx/multibyte.h"

View File

@ -59,7 +59,7 @@
#include "rustls.h" /* Rustls versions */
#include "../slist.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../strcase.h"
#include "../url.h"
#include "../progress.h"

View File

@ -54,7 +54,7 @@
#endif
#include "../urldata.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "vtls.h"
#include "vtls_int.h"
#include "vtls_scache.h"

View File

@ -39,7 +39,7 @@
#include "../urldata.h"
#include "vtls.h"
#include "../sendf.h"
#include "../curl_trc.h"
#include "../curlx/base64.h"
#include "x509asn1.h"
#include "../curlx/dynbuf.h"

View File

@ -33,6 +33,7 @@
#include "curlx/base64.h"
#include "connect.h"
#include "sendf.h"
#include "curl_trc.h"
#include "multiif.h"
#include "ws.h"
#include "easyif.h"

View File

@ -24,7 +24,7 @@
#include "unitcheck.h"
#include "urldata.h"
#include "sendf.h"
#include "curl_trc.h"
/*
* This test hardcodes the knowledge of the buffer size which is internal to