Skip to content

Commit 959dfcf

Browse files
spearcegitster
authored andcommitted
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>
1 parent 206b099 commit 959dfcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

remote-curl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ static int post_rpc(struct rpc_state *rpc)
453453

454454
headers = curl_slist_append(headers, rpc->hdr_content_type);
455455
headers = curl_slist_append(headers, rpc->hdr_accept);
456+
headers = curl_slist_append(headers, "Expect:");
456457

457458
if (large_request) {
458459
/* The request body is large and the size cannot be predicted.
459460
* We must use chunked encoding to send it.
460461
*/
461-
headers = curl_slist_append(headers, "Expect:");
462462
headers = curl_slist_append(headers, "Transfer-Encoding: chunked");
463463
rpc->initial_buffer = 1;
464464
curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, rpc_out);

0 commit comments

Comments
 (0)