[X2Go-Commits] [x2goclient] 226/276: src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise maximum startup time to 5 seconds and break out early, if the process went into running state earlier.

git-admin at x2go.org git-admin at x2go.org
Sat Dec 31 01:35:30 CET 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit 35cbbd57358ea19ec03dbf784b6d4ff38f39dc59
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Sep 23 08:00:19 2016 +0200

    src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise maximum startup time to 5 seconds and break out early, if the process went into running state earlier.
---
 debian/changelog     |    3 +++
 src/onmainwindow.cpp |    8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0d8af0a..162a795 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -405,6 +405,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
       and code related to non-user-mode-sshd setups. Simplifies code a bit and
       we want to always start a user-mode OpenSSH server anyway. Also get rid
       of the clientport variable that is now unnecessary.
+    - src/onmainwindow.cpp: when starting sshd on Unix-based plattforms, raise
+      maximum startup time to 5 seconds and break out early, if the process
+      went into running state earlier.
 
   [ Bernard Cafarelli ]
   * New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 737a6da..3646554 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10480,9 +10480,13 @@ bool ONMainWindow::startSshd()
     sshd->start (binary, arguments);
 #endif /* defined (Q_OS_WIN) */
 
-    // Allow sshd a grace time of 3 seconds to come up.
-    QTime sleepTime = QTime::currentTime ().addSecs (3);
+    // Allow sshd a grace time of 5 seconds to come up.
+    QTime sleepTime = QTime::currentTime ().addSecs (5);
     while (QTime::currentTime () < sleepTime) {
+        if (QProcess::Running == sshd->state ()) {
+            break;
+        }
+
         QCoreApplication::processEvents (QEventLoop::AllEvents, 100);
     }
 

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list