Skip to content

Commit

Permalink
fixup minor polish for disable-http
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Dec 11, 2020
1 parent 986d252 commit 2901a45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/getinfo.c
Expand Up @@ -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:
Expand All @@ -120,6 +121,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
break;
}
}
#endif
}
*param_charp = m;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/setopt.c
Expand Up @@ -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:
/*
Expand Down
4 changes: 3 additions & 1 deletion lib/urldata.h
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 2901a45

Please sign in to comment.