ngtcp2: adjust config and code checks for ngtcp2 without nghttp3

- make configure show on HTTP3 feature that both ngtcp2 and nghttp3
  are in play
- define ENABLE_QUIC only when USE_NGTCP2 and USE_NGHTTP3 are defined
- add USE_NGHTTP3 in the ngtcp2 implementation

Fixes #10793
Closes #10821
This commit is contained in:
Stefan Eissing 2023-03-23 09:39:37 +01:00 committed by Daniel Stenberg
parent 5ddd5f2619
commit 78f73f79ca
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
5 changed files with 8 additions and 7 deletions

View File

@ -175,7 +175,7 @@ curl_headers_msg="enabled (--disable-headers-api)"
ssl_backends= ssl_backends=
curl_h1_msg="enabled (internal)" curl_h1_msg="enabled (internal)"
curl_h2_msg="no (--with-nghttp2, --with-hyper)" curl_h2_msg="no (--with-nghttp2, --with-hyper)"
curl_h3_msg="no (--with-ngtcp2, --with-quiche --with-msh3)" curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-msh3)"
enable_altsvc="yes" enable_altsvc="yes"
hsts="yes" hsts="yes"

View File

@ -833,7 +833,8 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
#define USE_HTTP2 #define USE_HTTP2
#endif #endif
#if defined(USE_NGTCP2) || defined(USE_QUICHE) || defined(USE_MSH3) #if (defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || \
defined(USE_QUICHE) || defined(USE_MSH3)
#define ENABLE_QUIC #define ENABLE_QUIC
#define USE_HTTP3 #define USE_HTTP3
#endif #endif

View File

@ -24,7 +24,7 @@
#include "curl_setup.h" #include "curl_setup.h"
#ifdef USE_NGTCP2 #if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
#include <ngtcp2/ngtcp2.h> #include <ngtcp2/ngtcp2.h>
#include <nghttp3/nghttp3.h> #include <nghttp3/nghttp3.h>

View File

@ -26,7 +26,7 @@
#include "curl_setup.h" #include "curl_setup.h"
#ifdef USE_NGTCP2 #if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
#ifdef HAVE_NETINET_UDP_H #ifdef HAVE_NETINET_UDP_H
#include <netinet/udp.h> #include <netinet/udp.h>

View File

@ -53,7 +53,7 @@
void Curl_quic_ver(char *p, size_t len) void Curl_quic_ver(char *p, size_t len)
{ {
#ifdef USE_NGTCP2 #if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
Curl_ngtcp2_ver(p, len); Curl_ngtcp2_ver(p, len);
#elif defined(USE_QUICHE) #elif defined(USE_QUICHE)
Curl_quiche_ver(p, len); Curl_quiche_ver(p, len);
@ -330,7 +330,7 @@ CURLcode Curl_cf_quic_create(struct Curl_cfilter **pcf,
{ {
(void)transport; (void)transport;
DEBUGASSERT(transport == TRNSPRT_QUIC); DEBUGASSERT(transport == TRNSPRT_QUIC);
#ifdef USE_NGTCP2 #if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
return Curl_cf_ngtcp2_create(pcf, data, conn, ai); return Curl_cf_ngtcp2_create(pcf, data, conn, ai);
#elif defined(USE_QUICHE) #elif defined(USE_QUICHE)
return Curl_cf_quiche_create(pcf, data, conn, ai); return Curl_cf_quiche_create(pcf, data, conn, ai);
@ -349,7 +349,7 @@ bool Curl_conn_is_http3(const struct Curl_easy *data,
const struct connectdata *conn, const struct connectdata *conn,
int sockindex) int sockindex)
{ {
#ifdef USE_NGTCP2 #if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
return Curl_conn_is_ngtcp2(data, conn, sockindex); return Curl_conn_is_ngtcp2(data, conn, sockindex);
#elif defined(USE_QUICHE) #elif defined(USE_QUICHE)
return Curl_conn_is_quiche(data, conn, sockindex); return Curl_conn_is_quiche(data, conn, sockindex);