diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-06-01 22:58:46 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-02 16:30:36 +0200 |
commit | 9c845be2797e2047547ec247cb037471aeb48bb0 (patch) | |
tree | 425caca2641780b7c29e339aa38ec0e17fc7c552 /lib/url.c | |
parent | cba70628aefbfee68b329f199eace7ae950e2286 (diff) | |
download | curl-9c845be2797e2047547ec247cb037471aeb48bb0.tar.gz |
urldata: let the HTTP method be in the set.* struct
When the method is updated inside libcurl we must still not change the
method as set by the user as then repeated transfers with that same
handle might not execute the same operation anymore!
This fixes the libcurl part of #5462
Test 1633 added to verify.
Closes #5499
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -462,7 +462,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) set->postfieldsize = -1; /* unknown size */ set->maxredirs = -1; /* allow any amount by default */ - set->httpreq = HTTPREQ_GET; /* Default HTTP request */ + set->method = HTTPREQ_GET; /* Default HTTP request */ set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */ #ifndef CURL_DISABLE_FTP set->ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */ @@ -3992,17 +3992,9 @@ CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn) data->state.done = FALSE; /* *_done() is not called yet */ data->state.expect100header = FALSE; - if(data->set.opt_no_body) /* in HTTP lingo, no body means using the HEAD request... */ - data->set.httpreq = HTTPREQ_HEAD; - else if(HTTPREQ_HEAD == data->set.httpreq) - /* ... but if unset there really is no perfect method that is the - "opposite" of HEAD but in reality most people probably think GET - then. The important thing is that we can't let it remain HEAD if the - opt_no_body is set FALSE since then we'll behave wrong when getting - HTTP. */ - data->set.httpreq = HTTPREQ_GET; + data->state.httpreq = HTTPREQ_HEAD; k->start = Curl_now(); /* start time */ k->now = k->start; /* current time is now */ |