]> granicus.if.org Git - curl/commitdiff
data->httpreq was not set properly
authorDaniel Stenberg <daniel@haxx.se>
Sat, 27 Jan 2001 17:58:15 +0000 (17:58 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 27 Jan 2001 17:58:15 +0000 (17:58 +0000)
lib/url.c

index 7a69ff69112f37f8c4854ee3fde2d84b22397ff7..58965123a89d4dca3c081359532fd11e458766ee 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -342,7 +342,8 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
     break;
   case CURLOPT_POST:
     data->bits.http_post = va_arg(param, long)?TRUE:FALSE;
-    data->httpreq = HTTPREQ_POST;
+    if(data->bits.http_post)
+      data->httpreq = HTTPREQ_POST;
     break;
   case CURLOPT_FILETIME:
     data->bits.get_filetime = va_arg(param, long)?TRUE:FALSE;
@@ -364,7 +365,8 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
     break;
   case CURLOPT_PUT:
     data->bits.http_put = va_arg(param, long)?TRUE:FALSE;
-    data->httpreq = HTTPREQ_PUT;
+    if(data->bits.http_put)
+      data->httpreq = HTTPREQ_PUT;
     break;
   case CURLOPT_MUTE:
     data->bits.mute = va_arg(param, long)?TRUE:FALSE;
@@ -406,12 +408,14 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
     break;
   case CURLOPT_CUSTOMREQUEST:
     data->customrequest = va_arg(param, char *);
-    data->httpreq = HTTPREQ_CUSTOM;
+    if(data->customrequest)
+      data->httpreq = HTTPREQ_CUSTOM;
     break;
   case CURLOPT_HTTPPOST:
     data->httppost = va_arg(param, struct HttpPost *);
     data->bits.http_formpost = data->httppost?1:0;
-    data->httpreq = HTTPREQ_POST_FORM;
+    if(data->bits.http_formpost)
+      data->httpreq = HTTPREQ_POST_FORM;
     break;
   case CURLOPT_INFILE:
     data->in = va_arg(param, FILE *);