fix builds with !http + nghttp2

_buildroulette/lib/http2.c:218:24: error: field has incomplete type 'struct h1_req_parser'
  218 |   struct h1_req_parser h1; /* parsing the request */
      |                        ^
_buildroulette/lib/http2.c:218:10: note: forward declaration of 'struct h1_req_parser'
  218 |   struct h1_req_parser h1; /* parsing the request */
      |          ^
_buildroulette/lib/http2.c:258:3: error: call to undeclared function 'Curl_h1_req_parse_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-funct
  258 |   Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
      |   ^
_buildroulette/lib/http2.c:258:39: error: use of undeclared identifier 'H1_PARSE_DEFAULT_MAX_LINE_LEN'
  258 |   Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
      |                                       ^
_buildroulette/lib/http2.c:282:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-funct
  282 |   Curl_h1_req_parse_free(&stream->h1);
      |   ^
_buildroulette/lib/http2.c:2237:14: error: call to undeclared function 'Curl_h1_req_parse_read'; ISO C99 and later do not support implicit function declarations [-Wimplicit-fun
 2237 |   nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result);
      |              ^
_buildroulette/lib/http2.c:2251:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-func
 2251 |   Curl_h1_req_parse_free(&stream->h1);
      |   ^
_buildroulette/lib/http2.c:2866:19: error: no member named 'http_neg' in 'struct UrlState'
 2866 |      (data->state.http_neg.wanted & CURL_HTTP_V2x) &&
      |       ~~~~~~~~~~~ ^
_buildroulette/lib/http2.c:2867:18: error: no member named 'http_neg' in 'struct UrlState'
 2867 |      data->state.http_neg.h2_prior_knowledge) {
      |      ~~~~~~~~~~~ ^
8 errors generated.
This commit is contained in:
Viktor Szakats 2025-07-18 18:37:56 +02:00
parent 4f1cfdc2de
commit 0482130edc
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 6 additions and 6 deletions

View file

@ -24,7 +24,7 @@
#include "curl_setup.h"
#ifdef USE_NGHTTP2
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2)
#include <stdint.h>
#include <nghttp2/nghttp2.h>
#include "urldata.h"
@ -3008,7 +3008,7 @@ void *Curl_nghttp2_realloc(void *ptr, size_t size, void *user_data)
return Curl_crealloc(ptr, size);
}
#else /* !USE_NGHTTP2 */
#else /* CURL_DISABLE_HTTP || !USE_NGHTTP2 */
/* Satisfy external references even if http2 is not compiled in. */
#include <curl/curl.h>
@ -3027,4 +3027,4 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
return NULL;
}
#endif /* USE_NGHTTP2 */
#endif /* !CURL_DISABLE_HTTP && USE_NGHTTP2 */

View file

@ -197,7 +197,7 @@ char *curl_version(void)
#ifdef USE_SSH
char ssh_version[30];
#endif
#ifdef USE_NGHTTP2
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2)
char h2_version[30];
#endif
#ifdef USE_HTTP3
@ -258,7 +258,7 @@ char *curl_version(void)
Curl_ssh_version(ssh_version, sizeof(ssh_version));
src[i++] = ssh_version;
#endif
#ifdef USE_NGHTTP2
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2)
Curl_http2_ver(h2_version, sizeof(h2_version));
src[i++] = h2_version;
#endif
@ -488,7 +488,7 @@ static const struct feat features_table[] = {
#ifndef CURL_DISABLE_HSTS
FEATURE("HSTS", NULL, CURL_VERSION_HSTS),
#endif
#if defined(USE_NGHTTP2)
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2)
FEATURE("HTTP2", NULL, CURL_VERSION_HTTP2),
#endif
#if defined(USE_HTTP3)