[X2Go-Commits] [x2goclient] 237/280: src/onmainwindow.cpp: let startSshd () act as a wrapper and be called multiple times.

git-admin at x2go.org git-admin at x2go.org
Wed Jan 18 12:26:09 CET 2017


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

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

commit 299f4e12b7e6a57e84e4d0479879f79ca3efb270
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Sep 24 23:04:46 2016 +0200

    src/onmainwindow.cpp: let startSshd () act as a wrapper and be called multiple times.
    
    Check if the OpenSSH Server is already running and return true,
    otherwise try to start it.
---
 debian/changelog     |    3 +++
 src/onmainwindow.cpp |   13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index d09f6ef..40d09c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -445,6 +445,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
     - src/onmainwindow.{cpp,h}: reformat generateKey () only.
     - src/onmainwindow.{cpp,h}: move createRSAKey () around.
     - src/onmainwindow.{cpp,h}: reformat createRSAKey () only.
+    - src/onmainwindow.cpp: let startSshd () act as a wrapper and be called
+      multiple times. Check if the OpenSSH Server is already running and
+      return true, otherwise try to start it.
 
   [ Bernard Cafarelli ]
   * New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 17cfec5..cb65b1e 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10479,6 +10479,19 @@ bool ONMainWindow::startSshd()
     {
         return false;
     }
+
+    /* Don't start sshd, if it's already running. */
+#ifdef Q_OS_WIN
+    if (winSshdStarted)
+#else /* defined (Q_OS_WIN) */
+    if (sshd)
+#endif /* defined (Q_OS_WIN) */
+    {
+        if (isServerRunning (clientSshPort.toInt ())) {
+            return (true);
+        }
+    }
+
     clientSshPort = "7022";
     QString etcDir=homeDir+"/.x2go/etc";
     int port=clientSshPort.toInt();

--
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