@matheusbsbs / matheus-bagliano / commits / 959dfcf42f
Fork 0

smart-http: Really never use Expect: 100-continue

libcurl may choose to try and use Expect: 100-continue for any type of POST, not just a Transfer: chunked-encoding type. Force it to disable this feature, as not all proxy servers support 100-continue and leaving it enabled can cause 1 second stalls during the negotiation phase of fetch-pack/upload-pack. In ("206b099d26 smart-http: Don't use Expect: 100-Continue") we tried to disable this for only large POST bodies, but it should be disabled for every POST body. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shawn O. Pearce committed Mar 14, 2011 at 11:28 UTC 959dfcf42f264e8644d88b355224ff468ebae10d
1 file changed +1 -1
remote-curl.c
+1 -1
@@ -453,12 +453,12 @@ static int post_rpc(struct rpc_state *rpc)
453
454 headers = curl_slist_append(headers, rpc->hdr_content_type);
455 headers = curl_slist_append(headers, rpc->hdr_accept);
456 + headers = curl_slist_append(headers, "Expect:");
457
458 if (large_request) {
459 /* The request body is large and the size cannot be predicted.
460 * We must use chunked encoding to send it.
461 */
461 - headers = curl_slist_append(headers, "Expect:");
462 headers = curl_slist_append(headers, "Transfer-Encoding: chunked");
463 rpc->initial_buffer = 1;
464 curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, rpc_out);