Subject: Re: [FIXUP] Fixup on tip of jt/http-auth-proto-v2-fix

From: Jeff King <[email-masked]>
Date: Wed, 27 Feb 2019 07:02:19 -0500

On Mon, Feb 25, 2019 at 03:49:01PM -0800, Jonathan Tan wrote:

> Thanks, Peff, for noticing this. It's because the client sometimes sends
> "0000" as a single request (that is, it flushes, and then before it
> sends any data, it flushes again). And post_rpc() assumes that it can
> always read something - which is usually correct, but not in this case;
> we read in stateless_connect() first, and if we read "0000", we need to
> tell post_rpc() to not read at all.
> 
> This is a fixup on the tip of jt/http-auth-proto-v2-fix that fixes that.

Thanks, I can confirm that this makes the problem go away (and your
explanation makes perfect sense to me).

> As for why the client sends a lone "0000", I'm not sure, but that's
> outside the scope of this patch set, I think.

Yeah, that does seem odd. I noticed it on noop fetches. So after we've
done "ls-refs", would "fetch" need to send a flush to say "I don't want
anything?" I guess not, since we're stateless, and it is literally
making a new HTTP request just to say nothing.

It does seem unique to protocol v2.

-Peff