summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-26 08:04:49 -0700
committerJunio C Hamano <gitster@pobox.com>2011-04-26 10:44:33 -0700
commit1e41827d2d5cf0e4c6ebff91958fa47d69b7ff42 (patch)
tree00e0d20ad6cd841e25442c7e42176860ebb19dfc /http.c
parentde1a2fdd38b138c4e4fed6412783dcb74d63d2da (diff)
downloadgit-1e41827d2d5cf0e4c6ebff91958fa47d69b7ff42.tar.gz
http: clear POSTFIELDS when initializing a slot
After posting a short request using CURLOPT_POSTFIELDS, if the slot is reused for posting a large payload, the slot ends up having both POSTFIELDS (which now points at a random garbage) and READFUNCTION, in which case the curl library tries to use the stale POSTFIELDS. Clear it as part of the general slot initialization in get_active_slot(). Heavylifting-by: Shawn Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Shawn Pearce <spearce@spearce.org>
Diffstat (limited to 'http.c')
-rw-r--r--http.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/http.c b/http.c
index ed6414a2aa..b642eac978 100644
--- a/http.c
+++ b/http.c
@@ -494,6 +494,7 @@ struct active_request_slot *get_active_slot(void)
curl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, NULL);
curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, NULL);
+ curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL);
curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);