On Mon, Nov 14, 2016 at 02:40:49PM -0500, Jeff King wrote: > On Mon, Nov 14, 2016 at 01:24:31PM -0500, Jeff King wrote: > > > 2. Have remote-curl understand enough of the protocol that it can > > abort rather than hang. > > > > I think that's effectively the approach of your patch, but for one > > specific case. But could we, for example, make sure that everything > > we proxy is a complete set of pktlines and ends with a flush? And > > if not, then we hang up on fetch-pack. > > > > I _think_ that would work, because even the pack is always encased > > in pktlines for smart-http. > > So something like this. It turned out to be a lot uglier than I had > hoped because we get fed the data from curl in odd-sized chunks, so we > need a state machine. > > But it does seem to work. At least it doesn't seem to break anything in > the test suite, and it fixes the new tests you added. I'd worry that > there's some obscure case where the response isn't packetized in the > same way. Actually, I take it back. I think it works for a single round of ref negotiation, but not for multiple. Enabling GIT_TEST_LONG=1 causes it to fail t5551. I think I've probably made a mis-assumption on exactly when in the HTTP protocol we will see a flush packet (and perhaps that is a sign that this protocol-snooping approach is not a good one). I don't have time to dig more on this tonight, and I'll be traveling for the rest of the week. So if anybody is interested, please feel free to dig into it. -Peff