From: Junio C Hamano <gitster@pobox.com>
To: "Li Linchao via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Jonathan Tan" <jonathantanmy@google.com>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Li Linchao" <lilinchao@oschina.cn>
Subject: Re: [PATCH v3] remote-curl: send Accept-Language header to server
Date: Mon, 13 Jun 2022 11:15:16 -0700 [thread overview]
Message-ID: <xmqqk09k77m3.fsf@gitster.g> (raw)
In-Reply-To: <pull.1251.v3.git.1655054421697.gitgitgadget@gmail.com> (Li Linchao via GitGitGadget's message of "Sun, 12 Jun 2022 17:20:21 +0000")
"Li Linchao via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Range-diff vs v2:
>
> 1: a2dd9d4070e ! 1: 99a4e23ceb1 remote-curl: send Accept-Language header to server
> @@ Commit message
> remote-curl: send Accept-Language header to server
>
> Git server end's ability to accept Accept-Language header was introduced
> - in f18604bbf2(http: add Accept-Language header if possible), but this is
> - only used by very early phase of the transfer, that's HTTP GET request to
> - discover references. For other phases, like POST request in the smart HTTP
> - the server side don't know what language the client speaks.
> + in f18604bbf2 (http: add Accept-Language header if possible, 2015-01-28),
> + but this is only used by very early phase of the transfer, which is HTTP
> + GET request to discover references. For other phases, like POST request
> + in the smart HTTP, the server does not know what language the client
> + speaks.
OK.
> -+ accept_language = http_get_accept_language_header();
> -+ if (accept_language) {
> -+ strbuf_addstr(&buf, accept_language);
> -+ rpc->hdr_accept_language = strbuf_detach(&buf, NULL);
> -+ }
> ++ rpc->hdr_accept_language = xstrdup_or_null(http_get_accept_language_header());
Nice.
> +@@ remote-curl.c: static int rpc_service(struct rpc_state *rpc, struct discovery *heads,
> + free(rpc->service_url);
> + free(rpc->hdr_content_type);
> + free(rpc->hdr_accept);
> ++ free(rpc->hdr_accept_language);
> + free(rpc->protocol_header);
> + free(rpc->buf);
> + strbuf_release(&buf);
OK.
> +@@ remote-curl.c: static int stateless_connect(const char *service_name)
> + free(rpc.service_url);
> + free(rpc.hdr_content_type);
> + free(rpc.hdr_accept);
> ++ free(rpc.hdr_accept_language);
> + free(rpc.protocol_header);
> + free(rpc.buf);
> + strbuf_release(&buf);
OK.
Thanks. Will queue.
next prev parent reply other threads:[~2022-06-13 19:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 8:53 [PATCH] remote-curl: send Accept-Language header to server Li Linchao via GitGitGadget
2022-06-08 23:32 ` Junio C Hamano
2022-06-09 6:35 ` [PATCH v2] " Li Linchao via GitGitGadget
2022-06-09 23:55 ` Junio C Hamano
2022-06-10 3:49 ` lilinchao
2022-06-10 4:22 ` lilinchao
2022-06-12 17:20 ` [PATCH v3] " Li Linchao via GitGitGadget
2022-06-13 18:15 ` Junio C Hamano [this message]
2022-06-13 21:32 ` Junio C Hamano
2022-06-13 22:08 ` Junio C Hamano
2022-06-13 22:15 ` Junio C Hamano
2022-07-11 5:58 ` [PATCH v4] " Li Linchao via GitGitGadget
2022-06-09 7:30 ` [PATCH] " Ævar Arnfjörð Bjarmason
2022-06-09 17:34 ` Junio C Hamano
2022-06-10 2:38 ` lilinchao
2022-07-03 0:57 ` Junio C Hamano
2022-07-05 10:06 ` lilinchao
2022-07-05 10:15 ` Ævar Arnfjörð Bjarmason
2022-07-05 18:06 ` Junio C Hamano
2022-07-05 17:53 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqk09k77m3.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=jonathantanmy@google.com \
--cc=lilinchao@oschina.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.