| 1 | package sshscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/" |
| 5 | "syncscip-go gomod github.com/golang/go/src go1.25.0 sync/" |
| 6 | |
| 7 | "github.com/git-lfs/git-lfs/v3/configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/" |
| 8 | "github.com/git-lfs/git-lfs/v3/errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/" |
| 9 | "github.com/git-lfs/git-lfs/v3/subprocessscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/" |
| 10 | "github.com/git-lfs/git-lfs/v3/trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/" |
| 11 | "github.com/git-lfs/pktlinescip-go gomod github.com/git-lfs/pktline 06e9096e2825 `github.com/git-lfs/pktline`/" |
| 12 | "github.com/rubyist/tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/" |
| 13 | ) |
| 14 | |
| 15 | type SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer# struct { |
| 16 | lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock. *syncscip-go gomod github.com/golang/go/src go1.25.0 sync/.RWMutexscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex# |
| 17 | connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn. []*PktlineConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection# |
| 18 | osEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#osEnv. configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/.Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment# |
| 19 | gitEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#gitEnv. configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/.Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment# |
| 20 | metascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#meta. *SSHMetadatascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHMetadata# |
| 21 | operationscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#operation. string |
| 22 | multiplexingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#multiplexing. bool |
| 23 | controlPathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#controlPath. string |
| 24 | } |
| 25 | |
| 26 | func NewSSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/NewSSHTransfer().(osEnv configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/.Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment#, gitEnv configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/.Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment#, meta *SSHMetadatascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHMetadata#, operation string) (*SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#, error) { |
| 27 | conn, multiplexing, controlPath, err := startConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/startConnection().(0, osEnv, gitEnv, meta, operation, "") |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | return &SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#{ |
| 32 | lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock.: &syncscip-go gomod github.com/golang/go/src go1.25.0 sync/.RWMutexscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#{}, |
| 33 | osEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#osEnv.: osEnv, |
| 34 | gitEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#gitEnv.: gitEnv, |
| 35 | metascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#meta.: meta, |
| 36 | operationscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#operation.: operation, |
| 37 | multiplexingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#multiplexing.: multiplexing, |
| 38 | controlPathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#controlPath.: controlPath, |
| 39 | connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.: []*PktlineConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#{conn}, |
| 40 | }, nil |
| 41 | } |
| 42 | |
| 43 | func startConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/startConnection().(id int, osEnv configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/.Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment#, gitEnv configscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/.Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment#, meta *SSHMetadatascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHMetadata#, operation string, multiplexControlPath string) (conn *PktlineConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#, multiplexing bool, controlPath string, err error) { |
| 44 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("spawning pure SSH connection (#%d)", id) |
| 45 | var errbuf bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer# |
| 46 | exe, args, multiplexing, controlPath := GetLFSExeAndArgsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/GetLFSExeAndArgs().(osEnv, gitEnv, meta, "git-lfs-transfer", operation, true, multiplexControlPath) |
| 47 | cmd, err := subprocessscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/.ExecCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/ExecCommand().(exe, args...) |
| 48 | if err != nil { |
| 49 | return nil, false, "", err |
| 50 | } |
| 51 | r, err := cmd.StdoutPipescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/Cmd#StdoutPipe().() |
| 52 | if err != nil { |
| 53 | return nil, false, "", err |
| 54 | } |
| 55 | w, err := cmd.StdinPipescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/Cmd#StdinPipe().() |
| 56 | if err != nil { |
| 57 | return nil, false, "", err |
| 58 | } |
| 59 | cmd.Stderrscip-go gomod github.com/golang/go/src go1.25.0 `os/exec`/Cmd#Stderr. = &errbuf |
| 60 | err = cmd.Startscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/Cmd#Start().() |
| 61 | if err != nil { |
| 62 | return nil, false, "", err |
| 63 | } |
| 64 | |
| 65 | var pl Pktlinescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/Pktline# |
| 66 | if osEnv.Boolscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Environment#Bool.("GIT_TRACE_PACKET", false) { |
| 67 | pl = &TraceablePktlinescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/TraceablePktline#{idscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/TraceablePktline#id.: id, plscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/TraceablePktline#pl.: pktlinescip-go gomod github.com/git-lfs/pktline 06e9096e2825 `github.com/git-lfs/pktline`/.NewPktlinescip-go gomod github.com/git-lfs/pktline 06e9096e2825 `github.com/git-lfs/pktline`/NewPktline().(r, w)} |
| 68 | } else { |
| 69 | pl = pktlinescip-go gomod github.com/git-lfs/pktline 06e9096e2825 `github.com/git-lfs/pktline`/.NewPktlinescip-go gomod github.com/git-lfs/pktline 06e9096e2825 `github.com/git-lfs/pktline`/NewPktline().(r, w) |
| 70 | } |
| 71 | conn = &PktlineConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#{ |
| 72 | cmdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#cmd.: cmd, |
| 73 | plscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#pl.: pl, |
| 74 | rscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#r.: r, |
| 75 | wscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#w.: w, |
| 76 | } |
| 77 | err = conn.Startscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#Start().() |
| 78 | if err != nil { |
| 79 | r.Closescip-go gomod github.com/golang/go/src go1.25.0 io/Closer#Close().() |
| 80 | w.Closescip-go gomod github.com/golang/go/src go1.25.0 io/Closer#Close().() |
| 81 | cmd.Waitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/subprocess`/Cmd#Wait().() |
| 82 | err = errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Joinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Join().(err, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Failed to connect to remote SSH server: %s", cmd.Stderrscip-go gomod github.com/golang/go/src go1.25.0 `os/exec`/Cmd#Stderr.))) |
| 83 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("pure SSH connection unsuccessful (#%d)", id) |
| 84 | } else { |
| 85 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("pure SSH connection successful (#%d)", id) |
| 86 | } |
| 87 | return conn, multiplexing, controlPath, err |
| 88 | } |
| 89 | |
| 90 | // Connection returns the nth connection (starting from 0) in this transfer |
| 91 | // instance or nil if there is no such item. |
| 92 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) IsMultiplexingEnabledscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#IsMultiplexingEnabled().() bool { |
| 93 | return st.multiplexingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#multiplexing. |
| 94 | } |
| 95 | |
| 96 | // Connection returns the nth connection (starting from 0) in this transfer |
| 97 | // instance if it is initialized and otherwise initializes a new connection and |
| 98 | // saves it in the nth position. In all cases, nil is returned with an error |
| 99 | // if n is greater than the maximum number of connections, including when |
| 100 | // the connection array itself is nil. |
| 101 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) Connectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#Connection().(n int) (*PktlineConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#, error) { |
| 102 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..RLockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#RLock().() |
| 103 | if n >= len(st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.) { |
| 104 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..RUnlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#RUnlock().() |
| 105 | return nil, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("pure SSH connection unavailable (#%d)", n)) |
| 106 | } |
| 107 | if st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[n] != nil { |
| 108 | defer st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..RUnlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#RUnlock().() |
| 109 | return st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[n], nil |
| 110 | } |
| 111 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..RUnlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#RUnlock().() |
| 112 | |
| 113 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..Lockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#Lock().() |
| 114 | defer st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..Unlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#Unlock().() |
| 115 | if st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[n] != nil { |
| 116 | return st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[n], nil |
| 117 | } |
| 118 | conn, _, err := st.spawnConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#spawnConnection().(n) |
| 119 | if err != nil { |
| 120 | return nil, err |
| 121 | } |
| 122 | st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[n] = conn |
| 123 | return conn, nil |
| 124 | } |
| 125 | |
| 126 | // ConnectionCount returns the number of connections this object has. |
| 127 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) ConnectionCountscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#ConnectionCount().() int { |
| 128 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..RLockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#RLock().() |
| 129 | defer st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..RUnlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#RUnlock().() |
| 130 | return len(st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.) |
| 131 | } |
| 132 | |
| 133 | // SetConnectionCount sets the number of connections to the specified number. |
| 134 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) SetConnectionCountscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#SetConnectionCount().(n int) error { |
| 135 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..Lockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#Lock().() |
| 136 | defer st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..Unlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#Unlock().() |
| 137 | return st.setConnectionCountscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#setConnectionCount().(n) |
| 138 | } |
| 139 | |
| 140 | // SetConnectionCountAtLeast sets the number of connections to be not less than |
| 141 | // the specified number. |
| 142 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) SetConnectionCountAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#SetConnectionCountAtLeast().(n int) error { |
| 143 | st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..Lockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#Lock().() |
| 144 | defer st.lockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#lock..Unlockscip-go gomod github.com/golang/go/src go1.25.0 sync/RWMutex#Unlock().() |
| 145 | count := len(st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.) |
| 146 | if n <= count { |
| 147 | return nil |
| 148 | } |
| 149 | return st.setConnectionCountscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#setConnectionCount().(n) |
| 150 | } |
| 151 | |
| 152 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) spawnConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#spawnConnection().(n int) (*PktlineConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#, string, error) { |
| 153 | conn, _, controlPath, err := startConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/startConnection().(n, st.osEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#osEnv., st.gitEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#gitEnv., st.metascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#meta., st.operationscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#operation., st.controlPathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#controlPath.) |
| 154 | if err != nil { |
| 155 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("failed to spawn pure SSH connection (#%d): %s", n, err) |
| 156 | return nil, "", err |
| 157 | } |
| 158 | return conn, controlPath, err |
| 159 | } |
| 160 | |
| 161 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) setConnectionCountscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#setConnectionCount().(n int) error { |
| 162 | count := len(st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.) |
| 163 | if n < count { |
| 164 | tn := n |
| 165 | if tn == 0 { |
| 166 | tn = 1 |
| 167 | } |
| 168 | for i, item := range st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[tn:count] { |
| 169 | if item == nil { |
| 170 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("skipping uninitialized lazy pure SSH connection (#%d) (resetting total from %d to %d)", tn+i, count, n) |
| 171 | continue |
| 172 | } |
| 173 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("terminating pure SSH connection (#%d) (resetting total from %d to %d)", tn+i, count, n) |
| 174 | if err := item.Endscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#End().(); err != nil { |
| 175 | return err |
| 176 | } |
| 177 | } |
| 178 | st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn. = st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[0:tn] |
| 179 | } else if n > count { |
| 180 | for i := count; i < n; i++ { |
| 181 | if i == 0 { |
| 182 | conn, controlPath, err := st.spawnConnectionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#spawnConnection().(i) |
| 183 | if err != nil { |
| 184 | return err |
| 185 | } |
| 186 | st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn. = append(st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn., conn) |
| 187 | st.controlPathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#controlPath. = controlPath |
| 188 | } else { |
| 189 | st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn. = append(st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn., nil) |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | if n == 0 && count > 0 { |
| 194 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("terminating pure SSH connection (#0) (resetting total from %d to %d)", count, n) |
| 195 | if err := st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn.[0].Endscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/PktlineConnection#End().(); err != nil { |
| 196 | return err |
| 197 | } |
| 198 | st.connscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#conn. = nil |
| 199 | st.controlPathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#controlPath. = "" |
| 200 | } |
| 201 | return nil |
| 202 | } |
| 203 | |
| 204 | func (st *SSHTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#) Shutdownscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#Shutdown().() error { |
| 205 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("shutting down pure SSH connections") |
| 206 | return st.SetConnectionCountscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/ssh`/SSHTransfer#SetConnectionCount().(0) |
| 207 | } |