Skip to content

Commit

Permalink
ssh error
Browse files Browse the repository at this point in the history
  • Loading branch information
Chat2DB-Pro committed May 30, 2024
1 parent 4c600f7 commit f6efffd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public static Session getSSHSession(SSHInfo ssh) {
}
if (session != null && StringUtils.isNotBlank(ssh.getRHost()) && StringUtils.isNotBlank(ssh.getRPort())) {
try {
String[] portForwardingL = session.getPortForwardingL();
if (portForwardingL != null && portForwardingL.length > 0) {
return session;
}
int localPort = !StringUtils.isBlank(ssh.getLocalPort()) ? Integer.parseInt(ssh.getLocalPort())
: NetUtil.getUsableLocalPort();
ssh.setLocalPort(String.valueOf(localPort));
Expand Down

0 comments on commit f6efffd

Please sign in to comment.