mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-15 18:02:58 +08:00
fix: 修复ssh_config中Host存在其他字符时第一次连接失败
This commit is contained in:
@@ -20,6 +20,7 @@ import java.net.InetSocketAddress
|
||||
import java.net.Proxy
|
||||
import java.time.Duration
|
||||
import kotlin.math.max
|
||||
import org.apache.sshd.client.config.hosts.HostConfigEntryResolver
|
||||
|
||||
object SshClients {
|
||||
private val timeout = Duration.ofSeconds(30)
|
||||
@@ -83,6 +84,8 @@ object SshClients {
|
||||
builder.forwardingFilter(AcceptAllForwardingFilter.INSTANCE)
|
||||
}
|
||||
|
||||
builder.hostConfigEntryResolver(HostConfigEntryResolver.EMPTY)
|
||||
|
||||
val sshClient = builder.build() as JGitSshClient
|
||||
val heartbeatInterval = max(host.options.heartbeatInterval, 3)
|
||||
CoreModuleProperties.HEARTBEAT_INTERVAL.set(sshClient, Duration.ofSeconds(heartbeatInterval.toLong()))
|
||||
|
||||
Reference in New Issue
Block a user