From 1e41827d2d5cf0e4c6ebff91958fa47d69b7ff42 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 26 Apr 2011 08:04:49 -0700 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano Acked-by: Shawn Pearce --- http.c | 1 + 1 file changed, 1 insertion(+) diff --git a/http.c b/http.c index ed6414a2a..b642eac97 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); -- 2.26.2