build: repair http disabled but mqtt enabled build

... as the mqtt code reuses the "method" originally used for HTTP.

Closes #6344
This commit is contained in:
Daniel Stenberg 2020-12-18 13:18:14 +01:00
parent e2075f2337
commit abb68c192a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 15 additions and 13 deletions

View File

@ -23,6 +23,17 @@
***************************************************************************/ ***************************************************************************/
#include "curl_setup.h" #include "curl_setup.h"
typedef enum {
HTTPREQ_NONE, /* first in list */
HTTPREQ_GET,
HTTPREQ_POST,
HTTPREQ_POST_FORM, /* we make a difference internally */
HTTPREQ_POST_MIME, /* we make a difference internally */
HTTPREQ_PUT,
HTTPREQ_HEAD,
HTTPREQ_LAST /* last in list */
} Curl_HttpReq;
#ifndef CURL_DISABLE_HTTP #ifndef CURL_DISABLE_HTTP
#ifdef USE_NGHTTP2 #ifdef USE_NGHTTP2
@ -35,17 +46,6 @@ extern const struct Curl_handler Curl_handler_http;
extern const struct Curl_handler Curl_handler_https; extern const struct Curl_handler Curl_handler_https;
#endif #endif
typedef enum {
HTTPREQ_NONE, /* first in list */
HTTPREQ_GET,
HTTPREQ_POST,
HTTPREQ_POST_FORM, /* we make a difference internally */
HTTPREQ_POST_MIME, /* we make a difference internally */
HTTPREQ_PUT,
HTTPREQ_HEAD,
HTTPREQ_LAST /* last in list */
} Curl_HttpReq;
/* Header specific functions */ /* Header specific functions */
bool Curl_compareheader(const char *headerline, /* line to check */ bool Curl_compareheader(const char *headerline, /* line to check */
const char *header, /* header keyword _with_ colon */ const char *header, /* header keyword _with_ colon */

View File

@ -1402,8 +1402,10 @@ struct UrlState {
int stream_weight; int stream_weight;
CURLU *uh; /* URL handle for the current parsed URL */ CURLU *uh; /* URL handle for the current parsed URL */
struct urlpieces up; struct urlpieces up;
#ifndef CURL_DISABLE_HTTP #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT)
Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */
#endif
#ifndef CURL_DISABLE_HTTP
size_t trailers_bytes_sent; size_t trailers_bytes_sent;
struct dynbuf trailers_buf; /* a buffer containing the compiled trailing struct dynbuf trailers_buf; /* a buffer containing the compiled trailing
headers */ headers */
@ -1706,7 +1708,7 @@ struct UserDefined {
the hostname and port to connect to */ the hostname and port to connect to */
curl_TimeCond timecondition; /* kind of time/date comparison */ curl_TimeCond timecondition; /* kind of time/date comparison */
time_t timevalue; /* what time to compare with */ time_t timevalue; /* what time to compare with */
#ifndef CURL_DISABLE_HTTP #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT)
Curl_HttpReq method; /* what kind of HTTP request (if any) is this */ Curl_HttpReq method; /* what kind of HTTP request (if any) is this */
#endif #endif
long httpversion; /* when non-zero, a specific HTTP version requested to long httpversion; /* when non-zero, a specific HTTP version requested to