[X2Go-Commits] [x2goclient] 136/142: pulsemanager.{cpp, h}: only allow changing PA or ESD ports when server is not currently running.

git-admin at x2go.org git-admin at x2go.org
Thu Jan 14 05:10:52 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 409092f3021c3d418e1962b66c2bc032376b3bd1
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Dec 31 00:55:17 2015 +0100

    pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running.
---
 debian/changelog     |    2 ++
 src/pulsemanager.cpp |   22 ++++++++++++++++++----
 src/pulsemanager.h   |    4 ++--
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b8deb35..1a17531 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -240,6 +240,8 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low
       (hopefully) logical fashion.
     - pulsemanager.cpp: add algorithm for actually extracting PA version
       number.
+    - pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is
+      not currently running.
   * debian/control:
     - Change apache2-dev | libc6-dev build dependency back to apache2-dev
       only. Otherwise, apache2-dev is not installed at all, even though
diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp
index 09fb791..7ffdfcf 100644
--- a/src/pulsemanager.cpp
+++ b/src/pulsemanager.cpp
@@ -554,12 +554,26 @@ std::uint16_t PulseManager::get_esd_port () {
   return (esd_port_);
 }
 
-void PulseManager::set_pulse_port (std::uint16_t pulse_port) {
-  pulse_port_ = pulse_port;
+bool PulseManager::set_pulse_port (std::uint16_t pulse_port) {
+  bool ret = false;
+
+  if (!(is_server_running ())) {
+    pulse_port_ = pulse_port;
+    ret = true;
+  }
+
+  return (ret);
 }
 
-void PulseManager::set_esd_port (std::uint16_t esd_port) {
-  esd_port_ = esd_port;
+bool PulseManager::set_esd_port (std::uint16_t esd_port) {
+  bool ret = false;
+
+  if (!(is_server_running ())) {
+    esd_port_ = esd_port;
+    ret = true;
+  }
+
+  return (ret);
 }
 
 void PulseManager::restart () {
diff --git a/src/pulsemanager.h b/src/pulsemanager.h
index ec5e27c..3dbd94f 100644
--- a/src/pulsemanager.h
+++ b/src/pulsemanager.h
@@ -52,8 +52,8 @@ class PulseManager: public QObject {
     std::uint16_t get_pulse_port ();
     std::uint16_t get_esd_port ();
 
-    void set_pulse_port (std::uint16_t pulse_port);
-    void set_esd_port (std::uint16_t esd_port);
+    bool set_pulse_port (std::uint16_t pulse_port);
+    bool set_esd_port (std::uint16_t esd_port);
 
 
   public slots:

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