summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-11 09:17:07 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-02-12 14:36:54 +0100
commita6d134e17ab8efb2f8fa7c4ff877f6ddb9685f14 (patch)
treea09a17d2b9a897b26227825d2e8f63f525f0eea7 /lib
parentaabc7ae5ecf70973add429b5acbc86d6a57e4da5 (diff)
downloadcurl-a6d134e17ab8efb2f8fa7c4ff877f6ddb9685f14.tar.gz
pretransfer: don't strlen() POSTFIELDS set for GET requests
... since that data won't be used in the request anyway. Fixes #3548 Reported-by: Renaud Allard Close #3549
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c5
-rw-r--r--lib/urldata.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 3a18c7bdd..27fe79074 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1526,11 +1526,14 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
if(data->set.httpreq == HTTPREQ_PUT)
data->state.infilesize = data->set.filesize;
- else {
+ else if((data->set.httpreq != HTTPREQ_GET) &&
+ (data->set.httpreq != HTTPREQ_HEAD)) {
data->state.infilesize = data->set.postfieldsize;
if(data->set.postfields && (data->state.infilesize == -1))
data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
}
+ else
+ data->state.infilesize = 0;
/* If there is a list of cookie files to read, do it now! */
if(data->change.cookielist)
diff --git a/lib/urldata.h b/lib/urldata.h
index ff3cc9a65..e137569ac 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1150,7 +1150,6 @@ typedef enum {
HTTPREQ_PUT,
HTTPREQ_HEAD,
HTTPREQ_OPTIONS,
- HTTPREQ_CUSTOM,
HTTPREQ_LAST /* last in list */
} Curl_HttpReq;