9c46a38281
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> |
||
---|---|---|
.. | ||
schemas | ||
adapterbase.go | ||
api_test.go | ||
api.go | ||
basic_download.go | ||
basic_upload.go | ||
custom_test.go | ||
custom.go | ||
errors_test.go | ||
errors.go | ||
manifest_test.go | ||
manifest.go | ||
meter.go | ||
ssh.go | ||
transfer_queue_test.go | ||
transfer_queue.go | ||
transfer_test.go | ||
transfer.go | ||
tus_upload.go | ||
verify_test.go | ||
verify.go |