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

git-admin at x2go.org git-admin at x2go.org
Sat Dec 10 13:36:22 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 64115b4bcc07b65a1efc406002a96a13087bf6d4
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 772a8b3..379ad65 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -423,6 +423,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 fec9703..30fdddc 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10445,6 +10445,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