mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12: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.net.Proxy
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
import org.apache.sshd.client.config.hosts.HostConfigEntryResolver
|
||||||
|
|
||||||
object SshClients {
|
object SshClients {
|
||||||
private val timeout = Duration.ofSeconds(30)
|
private val timeout = Duration.ofSeconds(30)
|
||||||
@@ -83,6 +84,8 @@ object SshClients {
|
|||||||
builder.forwardingFilter(AcceptAllForwardingFilter.INSTANCE)
|
builder.forwardingFilter(AcceptAllForwardingFilter.INSTANCE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.hostConfigEntryResolver(HostConfigEntryResolver.EMPTY)
|
||||||
|
|
||||||
val sshClient = builder.build() as JGitSshClient
|
val sshClient = builder.build() as JGitSshClient
|
||||||
val heartbeatInterval = max(host.options.heartbeatInterval, 3)
|
val heartbeatInterval = max(host.options.heartbeatInterval, 3)
|
||||||
CoreModuleProperties.HEARTBEAT_INTERVAL.set(sshClient, Duration.ofSeconds(heartbeatInterval.toLong()))
|
CoreModuleProperties.HEARTBEAT_INTERVAL.set(sshClient, Duration.ofSeconds(heartbeatInterval.toLong()))
|
||||||
|
|||||||
Reference in New Issue
Block a user