git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] smart-http: Really never use Expect: 100-continue

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 14, 2011, 18:28 UTC
Message-ID
<1300127297-8025-1-git-send-email-spearce@spearce.org>

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>
---
 This should be applied onto the tip of sp/maint-smart-http-sans-100-continue.
 remote-curl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/remote-curl.c b/remote-curl.c
index 256326a..1f41a90 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -453,12 +453,12 @@ static int post_rpc(struct rpc_state *rpc)
 
 	headers = curl_slist_append(headers, rpc->hdr_content_type);
 	headers = curl_slist_append(headers, rpc->hdr_accept);
+	headers = curl_slist_append(headers, "Expect:");
 
 	if (large_request) {
 		/* The request body is large and the size cannot be predicted.
 		 * We must use chunked encoding to send it.
 		 */
-		headers = curl_slist_append(headers, "Expect:");
 		headers = curl_slist_append(headers, "Transfer-Encoding: chunked");
 		rpc->initial_buffer = 1;
 		curl_easy_setopt(slot->curl, CURLOPT_READFUNCTION, rpc_out);
-- 
1.7.4.1.408.gb6b16.dirty
Next: Junio C Hamano
Message 1 of 2 in “smart-http: Really never use Expect: 100-continue”
  1. smart-http: Really never use Expect: 100-continueShawn O. Pearce, Mar 14, 2011
  2. Junio C HamanoMar 14, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.