From f2321419e34572fdf3c3436f50bd5248641c4f00 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 18 Jul 2025 20:53:26 +0200 Subject: [PATCH] fix !http + http3 builds lib/vquic/curl_osslq.c:579:24: error: field has incomplete type 'struct h1_req_parser' 579 | struct h1_req_parser h1; /* h1 request parsing */ | ^ lib/vquic/curl_osslq.c:579:10: note: forward declaration of 'struct h1_req_parser' 579 | struct h1_req_parser h1; /* h1 request parsing */ | ^ lib/vquic/curl_osslq.c:598:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 598 | Curl_h1_req_parse_free(&stream->h1); | ^ lib/vquic/curl_osslq.c:635:3: error: call to undeclared function 'Curl_h1_req_parse_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 635 | Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); | ^ lib/vquic/curl_osslq.c:635:39: error: use of undeclared identifier 'H1_PARSE_DEFAULT_MAX_LINE_LEN' 635 | Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); | ^ lib/vquic/curl_osslq.c:1889:14: error: call to undeclared function 'Curl_h1_req_parse_read'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1889 | nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, err); | ^ lib/vquic/curl_osslq.c:1904:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1904 | Curl_h1_req_parse_free(&stream->h1); | ^ 6 errors generated. lib/vquic/vquic.c:76:3: error: call to undeclared function 'Curl_osslq_ver'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 76 | Curl_osslq_ver(p, len); | ^ lib/vquic/vquic.c:691:10: error: call to undeclared function 'Curl_cf_osslq_create'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 691 | return Curl_cf_osslq_create(pcf, data, conn, ai); | ^ 2 errors generated. Undefined symbols for architecture arm64: "_Curl_cf_quic_create", referenced from: _transport_providers in unity_0_c.c.o "_Curl_vquic_init", referenced from: _global_init in unity_1_c.c.o options='-DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_BINDLOCAL=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DICT=ON -DCURL_DISABLE_DIGEST_AUTH=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_FILE=ON -DCURL_DISABLE_FORM_API=ON -DCURL_DISABLE_FTP=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_HTTP=ON -DCURL_DISABLE_HTTP_AUTH=ON -DCURL_DISABLE_IMAP=ON -DCURL_DISABLE_INSTALL=ON -DCURL_DISABLE_IPFS=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_MQTT=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_RTSP=ON -DCURL_DISABLE_SHA512_256=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SMB=ON -DCURL_DISABLE_SMTP=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_TFTP=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DENABLE_DEBUG=ON -DENABLE_UNICODE=ON -DHTTP_ONLY=ON -DUSE_SSLS_EXPORT=ON -DENABLE_CURLDEBUG=ON -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON' --- lib/connect.c | 2 +- lib/version.c | 8 ++++---- lib/vquic/curl_osslq.c | 5 +++-- lib/vquic/curl_osslq.h | 3 ++- lib/vquic/vquic.c | 6 +++--- lib/vquic/vquic.h | 4 ++-- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/connect.c b/lib/connect.c index ac16c3399b..132f80bfa7 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -1195,7 +1195,7 @@ const #endif struct transport_provider transport_providers[] = { { TRNSPRT_TCP, Curl_cf_tcp_create }, -#ifdef USE_HTTP3 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) { TRNSPRT_QUIC, Curl_cf_quic_create }, #endif #ifndef CURL_DISABLE_TFTP diff --git a/lib/version.c b/lib/version.c index d58e068c53..ebf20aa30a 100644 --- a/lib/version.c +++ b/lib/version.c @@ -200,7 +200,7 @@ char *curl_version(void) #if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) char h2_version[30]; #endif -#ifdef USE_HTTP3 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) char h3_version[30]; #endif #ifdef USE_LIBRTMP @@ -262,7 +262,7 @@ char *curl_version(void) Curl_http2_ver(h2_version, sizeof(h2_version)); src[i++] = h2_version; #endif -#ifdef USE_HTTP3 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) Curl_quic_ver(h3_version, sizeof(h3_version)); src[i++] = h3_version; #endif @@ -491,7 +491,7 @@ static const struct feat features_table[] = { #if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) FEATURE("HTTP2", NULL, CURL_VERSION_HTTP2), #endif -#if defined(USE_HTTP3) +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) FEATURE("HTTP3", NULL, CURL_VERSION_HTTP3), #endif #if defined(USE_SSL) && !defined(CURL_DISABLE_PROXY) && \ @@ -673,7 +673,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp) } #endif -#ifdef USE_HTTP3 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) { static char quicbuffer[80]; Curl_quic_ver(quicbuffer, sizeof(quicbuffer)); diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 477e883e6a..4026ffc392 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -24,7 +24,8 @@ #include "../curl_setup.h" -#if defined(USE_OPENSSL_QUIC) && defined(USE_NGHTTP3) +#if !defined(CURL_DISABLE_HTTP) && defined(USE_OPENSSL_QUIC) && \ + defined(USE_NGHTTP3) #include #include @@ -2443,4 +2444,4 @@ void Curl_osslq_ver(char *p, size_t len) (void)msnprintf(p, len, "nghttp3/%s", ht3->version_str); } -#endif /* USE_OPENSSL_QUIC && USE_NGHTTP3 */ +#endif /* !CURL_DISABLE_HTTP && USE_OPENSSL_QUIC && USE_NGHTTP3 */ diff --git a/lib/vquic/curl_osslq.h b/lib/vquic/curl_osslq.h index a2809c92bc..9f5025f8ae 100644 --- a/lib/vquic/curl_osslq.h +++ b/lib/vquic/curl_osslq.h @@ -26,7 +26,8 @@ #include "../curl_setup.h" -#if defined(USE_OPENSSL_QUIC) && defined(USE_NGHTTP3) +#if !defined(CURL_DISABLE_HTTP) && defined(USE_OPENSSL_QUIC) && \ + defined(USE_NGHTTP3) #ifdef HAVE_NETINET_UDP_H #include diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index 691c0d3fa7..c686058ae8 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -52,7 +52,7 @@ #include "../memdebug.h" -#ifdef USE_HTTP3 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) #define NW_CHUNK_SIZE (64 * 1024) #define NW_SEND_CHUNKS 2 @@ -728,7 +728,7 @@ CURLcode Curl_conn_may_http3(struct Curl_easy *data, return CURLE_OK; } -#else /* USE_HTTP3 */ +#else /* CURL_DISABLE_HTTP || !USE_HTTP3 */ CURLcode Curl_conn_may_http3(struct Curl_easy *data, const struct connectdata *conn, @@ -741,4 +741,4 @@ CURLcode Curl_conn_may_http3(struct Curl_easy *data, return CURLE_NOT_BUILT_IN; } -#endif /* !USE_HTTP3 */ +#endif /* !CURL_DISABLE_HTTP && USE_HTTP3 */ diff --git a/lib/vquic/vquic.h b/lib/vquic/vquic.h index 3577a857e3..0f81334f29 100644 --- a/lib/vquic/vquic.h +++ b/lib/vquic/vquic.h @@ -26,7 +26,7 @@ #include "../curl_setup.h" -#ifdef USE_HTTP3 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) struct Curl_cfilter; struct Curl_easy; struct connectdata; @@ -51,7 +51,7 @@ extern struct Curl_cftype Curl_cft_http3; #else #define Curl_vquic_init() 1 -#endif /* !USE_HTTP3 */ +#endif /* !CURL_DISABLE_HTTP && USE_HTTP3 */ CURLcode Curl_conn_may_http3(struct Curl_easy *data, const struct connectdata *conn,