From 2901a4529c59b485c717805db7a5add37fb73244 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 11 Dec 2020 17:01:35 +0100 Subject: [PATCH] fixup minor polish for disable-http --- lib/getinfo.c | 2 ++ lib/setopt.c | 2 ++ lib/urldata.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/getinfo.c b/lib/getinfo.c index fd8f4e8430a008..67ea07d2eee7c9 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -101,6 +101,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, if(!m) { if(data->set.opt_no_body) m = "HEAD"; +#ifndef CURL_DISABLE_HTTP else { switch(data->state.httpreq) { case HTTPREQ_POST: @@ -120,6 +121,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, break; } } +#endif } *param_charp = m; } diff --git a/lib/setopt.c b/lib/setopt.c index 034dee5383b6da..b8fc4e8da50c77 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -274,11 +274,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * Do not include the body part in the output data stream. */ data->set.opt_no_body = (0 != va_arg(param, long)) ? TRUE : FALSE; +#ifndef CURL_DISABLE_HTTP if(data->set.opt_no_body) /* in HTTP lingo, no body means using the HEAD request... */ data->set.method = HTTPREQ_HEAD; else if(data->set.method == HTTPREQ_HEAD) data->set.method = HTTPREQ_GET; +#endif break; case CURLOPT_FAILONERROR: /* diff --git a/lib/urldata.h b/lib/urldata.h index 725ebeb89baee1..794e95df8f4e10 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1400,8 +1400,8 @@ struct UrlState { int stream_weight; CURLU *uh; /* URL handle for the current parsed URL */ struct urlpieces up; - Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ #ifndef CURL_DISABLE_HTTP + Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ size_t trailers_bytes_sent; struct dynbuf trailers_buf; /* a buffer containing the compiled trailing headers */ @@ -1704,7 +1704,9 @@ struct UserDefined { the hostname and port to connect to */ curl_TimeCond timecondition; /* kind of time/date comparison */ time_t timevalue; /* what time to compare with */ +#ifndef CURL_DISABLE_HTTP Curl_HttpReq method; /* what kind of HTTP request (if any) is this */ +#endif long httpversion; /* when non-zero, a specific HTTP version requested to be used in the library's request(s) */ struct ssl_config_data ssl; /* user defined SSL stuff */