[X2Go-Commits] [x2goclient] 02/04: 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
Fri Sep 23 08:22:16 CEST 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 66e14dda84240d1412276d8220be61eff18f3eb2
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 25b38b4..4659772 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -399,6 +399,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.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Mon, 19 Sep 2016 09:07:07 +0200
 
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index e9a9f92..c915da7 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10455,9 +10455,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