From: Junio C Hamano Date: Sun, 30 Sep 2012 05:28:20 +0000 (-0700) Subject: Merge branch 'sp/maint-http-enable-gzip' X-Git-Tag: v1.8.0-rc0~14 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c318040a3633475b591d9b9ece5877df415cf1d8?hp=-c Merge branch 'sp/maint-http-enable-gzip' Allows a more common 'gzip' Accept-Encoding to be used. * sp/maint-http-enable-gzip: Enable info/refs gzip decompression in HTTP client --- c318040a3633475b591d9b9ece5877df415cf1d8 diff --combined remote-curl.c index 2359f59202,4a0927e5cf..a2696082fb --- a/remote-curl.c +++ b/remote-curl.c @@@ -95,7 -95,7 +95,7 @@@ static struct discovery* discover_refs( struct strbuf buffer = STRBUF_INIT; struct discovery *last = last_discovery; char *refs_url; - int http_ret, is_http = 0, proto_git_candidate = 1; + int http_ret, is_http = 0; if (last && !strcmp(service, last->service)) return last; @@@ -113,6 -113,19 +113,6 @@@ refs_url = strbuf_detach(&buffer, NULL); http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE); - - /* try again with "plain" url (no ? or & appended) */ - if (http_ret != HTTP_OK && http_ret != HTTP_NOAUTH) { - free(refs_url); - strbuf_reset(&buffer); - - proto_git_candidate = 0; - strbuf_addf(&buffer, "%sinfo/refs", url); - refs_url = strbuf_detach(&buffer, NULL); - - http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE); - } - switch (http_ret) { case HTTP_OK: break; @@@ -131,7 -144,8 +131,7 @@@ last->buf_alloc = strbuf_detach(&buffer, &last->len); last->buf = last->buf_alloc; - if (is_http && proto_git_candidate - && 5 <= last->len && last->buf[4] == '#') { + if (is_http && 5 <= last->len && last->buf[4] == '#') { /* smart HTTP response; validate that the service * pkt-line matches our request. */ @@@ -379,7 -393,7 +379,7 @@@ static int probe_rpc(struct rpc_state * curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0); curl_easy_setopt(slot->curl, CURLOPT_POST, 1); curl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url); - curl_easy_setopt(slot->curl, CURLOPT_ENCODING, ""); + curl_easy_setopt(slot->curl, CURLOPT_ENCODING, NULL); curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, "0000"); curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4); curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers); @@@ -435,7 -449,7 +435,7 @@@ static int post_rpc(struct rpc_state *r curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0); curl_easy_setopt(slot->curl, CURLOPT_POST, 1); curl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url); - curl_easy_setopt(slot->curl, CURLOPT_ENCODING, ""); + curl_easy_setopt(slot->curl, CURLOPT_ENCODING, "gzip"); headers = curl_slist_append(headers, rpc->hdr_content_type); headers = curl_slist_append(headers, rpc->hdr_accept);