diff options
author | Jeff King <peff@peff.net> | 2020-01-08 02:10:09 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-08 09:32:38 -0800 |
commit | 4d8cab95ccdac8a0859ba0a6c044bd024f8d8a5f (patch) | |
tree | 371e61d50672303621cb5dbe30e3d053331a4948 /builtin/merge.c | |
parent | Git 2.23.1 (diff) | |
download | tgif-4d8cab95ccdac8a0859ba0a6c044bd024f8d8a5f.tar.xz |
transport: don't flush when disconnecting stateless-rpc helper
Since ba227857d2 (Reduce the number of connects when fetching,
2008-02-04), when we disconnect a git transport, we send a final flush
packet. This cleanly tells the other side that we're done, and avoids
the other side complaining "the remote end hung up unexpectedly" (though
we'd only see that for transports that pass along the server stderr,
like ssh or local-host).
But when we've initiated a v2 stateless-connect session over a transport
helper, there's no point in sending this flush packet. Each operation
we've performed is self-contained, and the other side is fine with us
hanging up between operations.
But much worse, by sending the flush packet we may cause the helper to
issue an entirely new request _just_ to send the flush packet. So we can
incur an extra network request just to say "by the way, we have nothing
more to send".
Let's drop this extra flush packet. As the test shows, this reduces the
number of POSTs required for a v2 ls-remote over http from 2 to 1.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge.c')
0 files changed, 0 insertions, 0 deletions