git-lfs/ssh
brian m. carlson 9c46a38281
ssh: support concurrent transfers using the pure SSH protocol
When using the pure SSH-based protocol, we can get much higher speeds by
multiplexing multiple connections on the same SSH connection.  If we're
using OpenSSH, let's enable the ControlMaster option unless
lfs.ssh.automultiplex is set to false, and multiplex these shell
operations over one connection.

We prefer XDG_RUNTIME_DIR because it's guaranteed to be private and we
can share many connections over one socket, but if that's not set, let's
default to creating a new temporary directory for the socket.  On
Windows, where the native SSH client doesn't support ControlMaster,
we should fall back to using multiple connections since we use
ControlMaster=auto.

Note that the option exists because users may already be using SSH
multiplexing and we would want to provide a way for them to disable
this, in addition to the case where users have an old or broken OpenSSH
which cannot support this option.

We pass the connection object into each worker and adjust our transfer
code to pass it into each function we invoke.  We also make sure to
properly terminate each connection at the end by reducing our connection
count to 0, which closes the extra (i.e., all) connections.

Co-authored-by: Chris Darroch <chrisd8088@github.com>
2021-07-20 19:15:59 +00:00
..
connection.go ssh: support concurrent transfers using the pure SSH protocol 2021-07-20 19:15:59 +00:00
pktline.go ssh: introduce an ID for multiple traced pkt-line connections 2021-07-20 19:15:59 +00:00
protocol.go ssh: implement protocol handling for pure SSH-based protocol 2021-07-20 18:39:12 +00:00
ssh_test.go ssh: support concurrent transfers using the pure SSH protocol 2021-07-20 19:15:59 +00:00
ssh.go ssh: support concurrent transfers using the pure SSH protocol 2021-07-20 19:15:59 +00:00