aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-04-03 21:44:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-04-03 21:44:49 +0000
commita9c1ca9fc5a80e858b0c85d8f8c838b4464526db (patch)
tree276acdf9cacecf5606884ed5be1f3a8d9c513a5a /lib
parentd051dd80874bffcd6df56a09ba6cc2cf29de4d88 (diff)
- Setting CURLOPT_NOBODY to FALSE will now switch the HTTP request method to
GET simply because previously when you set CURLOPT_NOBODY to TRUE first and then FALSE you'd end up in a broken state where a HTTP request would do a HEAD by still act a lot like for a GET and hang waiting for the content etc.
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 9d782359b..92f7156d3 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -858,9 +858,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
* Do not include the body part in the output data stream.
*/
data->set.opt_no_body = (bool)(0 != va_arg(param, long));
- if(data->set.opt_no_body)
- /* in HTTP lingo, this means using the HEAD request */
- data->set.httpreq = HTTPREQ_HEAD;
+
+ /* in HTTP lingo, no body means using the HEAD request and 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 = data->set.opt_no_body?HTTPREQ_HEAD:HTTPREQ_GET;
break;
case CURLOPT_FAILONERROR:
/*