From: Junio C Hamano Date: Tue, 26 Apr 2011 15:04:49 +0000 (-0700) Subject: http: clear POSTFIELDS when initializing a slot X-Git-Tag: v1.7.5.1~2^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1e41827;p=git.git 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 --- 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);