git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 5/5] remote-curl: use post_rpc() for protocol v2 also
Date: Mon, 25 Feb 2019 17:08:41 -0500	[thread overview]
Message-ID: <20190225220841.GA3248@sigill.intra.peff.net> (raw)
In-Reply-To: <b0ff17d324d46822da9db898d187dcc5fb0467ca.1550780213.git.jonathantanmy@google.com>

On Thu, Feb 21, 2019 at 12:24:41PM -0800, Jonathan Tan wrote:

> When transmitting and receiving POSTs for protocol v0 and v1,
> remote-curl uses post_rpc() (and associated functions), but when doing
> the same for protocol v2, it uses a separate set of functions
> (proxy_rpc() and others). Besides duplication of code, this has caused
> at least one bug: the auth retry mechanism that was implemented in v0/v1
> was not implemented in v2.
> 
> To fix this issue and avoid it in the future, make remote-curl also use
> post_rpc() when handling protocol v2. Because line lengths are written
> to the HTTP request in protocol v2 (unlike in protocol v0/v1), this
> necessitates changes in post_rpc() and some of the functions it uses;
> perform these changes too.

This patch seems to cause noop fetches from GitHub to report "the remote
end hung up unexpectedly" at the end of the fetch (I have
protocol.version=2 set in the examples below):

  [parent is good]
  $ git checkout 0cdb2a12ad0300b5d0cb5bb6e8999034ae4b9bef^
  $ make
  $ bin-wrappers/git fetch https://github.com/git/git
  From https://github.com/git/git
   * branch                  HEAD       -> FETCH_HEAD

  [this patch is bad]
  $ git checkout 0cdb2a12ad0300b5d0cb5bb6e8999034ae4b9bef
  $ make
  $ bin-wrappers/git fetch https://github.com/git/git
  From https://github.com/git/git
   * branch                  HEAD       -> FETCH_HEAD
  fatal: the remote end hung up unexpectedly

I haven't dug, so it's possible that GitHub's server-side is doing
something slightly odd or wrong. But given the nature of the patch, I'd
suspect we just aren't noticing EOF correctly.

-Peff

  parent reply	other threads:[~2019-02-25 22:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 19:06 [PATCH 0/5] Protocol v2 fix: http and auth Jonathan Tan
2019-02-14 19:06 ` [PATCH 1/5] remote-curl: reduce scope of rpc_state.argv Jonathan Tan
2019-02-14 19:06 ` [PATCH 2/5] remote-curl: reduce scope of rpc_state.stdin_preamble Jonathan Tan
2019-02-14 19:06 ` [PATCH 3/5] remote-curl: reduce scope of rpc_state.result Jonathan Tan
2019-02-14 19:06 ` [PATCH 4/5] remote-curl: refactor reading into rpc_state's buf Jonathan Tan
2019-02-14 19:06 ` [PATCH 5/5] remote-curl: use post_rpc() for protocol v2 also Jonathan Tan
2019-02-14 22:47   ` Junio C Hamano
2019-02-21 13:46   ` Jeff King
2019-02-21 19:26     ` Jonathan Tan
2019-02-21 13:47 ` [PATCH 0/5] Protocol v2 fix: http and auth Jeff King
2019-02-21 20:24 ` [PATCH v2 " Jonathan Tan
2019-02-21 20:24   ` [PATCH v2 1/5] remote-curl: reduce scope of rpc_state.argv Jonathan Tan
2019-02-21 20:24   ` [PATCH v2 2/5] remote-curl: reduce scope of rpc_state.stdin_preamble Jonathan Tan
2019-02-21 20:24   ` [PATCH v2 3/5] remote-curl: reduce scope of rpc_state.result Jonathan Tan
2019-02-21 20:24   ` [PATCH v2 4/5] remote-curl: refactor reading into rpc_state's buf Jonathan Tan
2019-02-21 20:24   ` [PATCH v2 5/5] remote-curl: use post_rpc() for protocol v2 also Jonathan Tan
2019-02-22 13:18     ` Eric Sunshine
2019-02-22 19:15       ` Eric Sunshine
2019-02-25 22:08     ` Jeff King [this message]
2019-02-25 23:49       ` [FIXUP] Fixup on tip of jt/http-auth-proto-v2-fix Jonathan Tan
2019-02-26  7:04         ` Jonathan Nieder
2019-02-26 18:18           ` Jonathan Tan
2019-03-04  3:45             ` Junio C Hamano
2019-02-27 12:02         ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190225220841.GA3248@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).