Merge branch 'stable-2.6'

* stable-2.6:
  Migration v57 setInt parameter trivial fix
  Disable closing idle Ssh connections again
This commit is contained in:
Shawn Pearce
2013-04-08 09:46:24 -07:00
3 changed files with 27 additions and 1 deletions

View File

@@ -159,6 +159,18 @@ public class SshDaemon extends SshServer implements SshInfo, LifecycleListener {
String.valueOf(MILLISECONDS.convert(ConfigUtil.getTimeUnit(cfg, "sshd",
null, "loginGraceTime", 120, SECONDS), SECONDS)));
long idleTimeoutSeconds = ConfigUtil.getTimeUnit(cfg, "sshd", null,
"idleTimeout", 0, SECONDS);
if (idleTimeoutSeconds == 0) {
// Since Apache SSHD does not allow to turn off closing idle connections,
// we fake it by using the highest timeout allowed by Apache SSHD, which
// amounts to ~24 days.
idleTimeoutSeconds = MILLISECONDS.toSeconds(Integer.MAX_VALUE);
}
getProperties().put(
IDLE_TIMEOUT,
String.valueOf(SECONDS.toMillis(idleTimeoutSeconds)));
final int maxConnectionsPerUser =
cfg.getInt("sshd", "maxConnectionsPerUser", 64);
if (0 < maxConnectionsPerUser) {