This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from 1f383a9 src/editconnectiondialog.cpp: do not connect signals to slots that do not exist on non-Linux platforms. new 688a221 src/onmainwindow.cpp: add -nopn parameter to VcXsrv startup options, making the binary fail if it wasn't able to bind the requested port on all addresses. new 15c5b01 src/onmainwindow.cpp: print out current DISPLAY value in debug log while starting X server. new 71b6eec src/onmainwindow.{cpp,h}: don't error out directly if starting the X.Org Server failed on Windows. new 94b93f5 {src/{onmainwindow.{cpp,h},help.cpp},man/man1/x2goclient.1}: add new option --xserver-start-limit, replacing the formerly hardcoded limit of three tries. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 15 +++++++ man/man1/x2goclient.1 | 8 ++++ src/help.cpp | 5 +++ src/onmainwindow.cpp | 114 ++++++++++++++++++++++++++++++++++++++++++++++---- src/onmainwindow.h | 4 +- 5 files changed, 137 insertions(+), 9 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 688a221996b8a6c900c4ad751fdce1881070567b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 11 23:15:55 2018 +0200 src/onmainwindow.cpp: add -nopn parameter to VcXsrv startup options, making the binary fail if it wasn't able to bind the requested port on all addresses. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 14b3290..b1b6318 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,6 +45,9 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium references. - src/editconnectiondialog.cpp: do not connect signals to slots that do not exist on non-Linux platforms. + - src/onmainwindow.cpp: add -nopn parameter to VcXsrv startup options, + making the binary fail if it wasn't able to bind the requested port on + all addresses. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 61641ff..bef04f5 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10001,6 +10001,17 @@ void ONMainWindow::startXOrg () { args<< option; } + + if (useInternalX) { + /* + * -nopn lets the server terminate if it couldn't bind on all interfaces. + * Only VcXsrv supports this option, though, and we don't want have external + * X servers fail to start due to unknown options, so only add the option + * if using the internal X server and the internal copy is VcXsrv-based. + */ + args << "-nopn"; + } + args<<dispString; } //#endif -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 15c5b017fa6ef22a39a5f031c81bc6ba84dcb836 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 11 23:19:11 2018 +0200 src/onmainwindow.cpp: print out current DISPLAY value in debug log while starting X server. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b1b6318..a45b70f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -48,6 +48,8 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.cpp: add -nopn parameter to VcXsrv startup options, making the binary fail if it wasn't able to bind the requested port on all addresses. + - src/onmainwindow.cpp: print out current DISPLAY value in debug log while + starting X.Org Server on Windows. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index bef04f5..53cf24d 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10040,6 +10040,7 @@ void ONMainWindow::startXOrg () x2goDebug<<"Running "<<exec<<" "<<args.join(" "); + x2goDebug << "Trying to start X.Org Server on DISPLAY: " << xDisplay; xorg->start ( exec, args ); @@ -10067,8 +10068,7 @@ void ONMainWindow::slotCheckXOrgConnection() ++waitingForX; if (isServerRunning(6000+xDisplay)) { - - x2goDebug<<"X.Org Server started."; + x2goDebug<<"X.Org Server started on DISPLAY " << xDisplay << "."; slotSetWinServersReady(); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 71b6eec557af9798b3b315592e241380fe6f0b90 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 11 23:20:25 2018 +0200 src/onmainwindow.{cpp,h}: don't error out directly if starting the X.Org Server failed on Windows. Instead, try starting it three times, each time with a higher DISPLAY offset. On busy client machines, several clients raced for the sockets previously and often failed to start. Also check if the server binary actually is still alive before doing the TCP connection checks. A dead server won't be able to listen on a socket in the first place. --- debian/changelog | 7 ++++++ src/onmainwindow.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++++++----- src/onmainwindow.h | 3 ++- 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index a45b70f..cfcbac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,6 +50,13 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium all addresses. - src/onmainwindow.cpp: print out current DISPLAY value in debug log while starting X.Org Server on Windows. + - src/onmainwindow.{cpp,h}: don't error out directly if starting the X.Org + Server failed on Windows. Instead, try starting it three times, each + time with a higher DISPLAY offset. On busy client machines, several + clients raced for the sockets previously and often failed to start. Also + check if the server binary actually is still alive before doing the TCP + connection checks. A dead server won't be able to listen on a socket in + the first place. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 53cf24d..0e4e18b 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -171,6 +171,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN xorg=0l; xDisplay=0; + x_start_tries_ = 0; #endif if(X2goSettings::centralSettings()) @@ -9945,8 +9946,10 @@ void ONMainWindow::slotCheckXOrgLog() xorgLogMutex.unlock(); } -void ONMainWindow::startXOrg () +void ONMainWindow::startXOrg (std::size_t start_offset) { + xDisplay += start_offset; + while ( isServerRunning ( 6000+xDisplay ) ) ++xDisplay; QString dispString; @@ -10058,6 +10061,7 @@ void ONMainWindow::startXOrg () { //check connection in slot and launch setWinServerReady waitingForX=0; + x_start_tries_ += 1; QTimer::singleShot(1000, this, SLOT(slotCheckXOrgConnection())); } // #endif @@ -10066,6 +10070,35 @@ void ONMainWindow::startXOrg () void ONMainWindow::slotCheckXOrgConnection() { ++waitingForX; + + /* Before we try to connect to the socket, let's check if the server actually is still running. */ + if (xorg->state () != QProcess::Running) { + /* + * Process died (crashed, terminated, whatever). We need to restart it, unless we already tried + * to do so multiple times unsuccessfully. + */ + if (3 < x_start_tries_) { + x2goDebug << "Unable to start X.Org Server for three times, terminating."; + + QMessageBox::critical (NULL, QString::null, + tr ("X.Org Server did not launch correctly after three tries.\n" + "Please check your installation.")); + + close (); + + return; + } + + x2goDebug << "Trying to re-start X.Org Server. Try count: " << x_start_tries_; + + delete xorg; + xorg = NULL; + + startXOrg (1); + + return; + } + if (isServerRunning(6000+xDisplay)) { x2goDebug<<"X.Org Server started on DISPLAY " << xDisplay << "."; @@ -10076,11 +10109,35 @@ void ONMainWindow::slotCheckXOrgConnection() { if (waitingForX > 10) { - QMessageBox::critical ( - 0,QString::null, - tr ( "Can't start X.Org Server.\n" - "Please check your installation." ) ); - close(); + /* + * Timeout reached. If we tried starting the X.Org Server less than three times, + * continue doing so (with a higher DISPLAY value). + * Otherwise error out. + */ + if (3 >= x_start_tries_) { + /* + * Server might still be running here, but deleting the QProcess object + * should kill it. + */ + x2goDebug << "Timeout reached waiting for the X.Org Server to open a listening TCP socket." << endl + << "Restarting on higher DISPLAY port. Try count: " << x_start_Tries; + + xorg->terminate (); + delete xorg; + xorg = NULL; + + startXOrg (1); + + return; + { + else { + QMessageBox::critical (NULL, QString::null, + tr ("Can't start X.Org Server.\n" + "Please check your installation.")); + close(); + + return; + } } else { diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 7272e66..d979c75 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -554,7 +554,7 @@ public: QSize getEmbedAreaSize(); #ifdef Q_OS_WIN static QString cygwinPath ( const QString& winPath ); - void startXOrg(); + void startXOrg(std::size_t start_offset = 0); static bool haveCygwinEntry(); static void removeCygwinEntry(); static QString U3DevicePath() @@ -876,6 +876,7 @@ private: QString xorgWidth; QString xorgHeight; int waitingForX; + std::size_t x_start_tries_; QRect dispGeometry; #endif -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 94b93f57c643a4660822831c54390d40d40240a4 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 12 00:31:19 2018 +0200 {src/{onmainwindow.{cpp,h},help.cpp},man/man1/x2goclient.1}: add new option --xserver-start-limit, replacing the formerly hardcoded limit of three tries. --- debian/changelog | 3 +++ man/man1/x2goclient.1 | 8 ++++++++ src/help.cpp | 5 +++++ src/onmainwindow.cpp | 38 ++++++++++++++++++++++++++++++++++---- src/onmainwindow.h | 1 + 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index cfcbac6..e030e15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -57,6 +57,9 @@ x2goclient (4.1.2.0-0x2go1) UNRELEASED; urgency=medium check if the server binary actually is still alive before doing the TCP connection checks. A dead server won't be able to listen on a socket in the first place. + - {src/{onmainwindow.{cpp,h},help.cpp},man/man1/x2goclient.1}: add new + option --xserver-start-limit, replacing the formerly hardcoded limit of + three tries. * x2goclient.spec: - Remove plugin references. * debian/rules: diff --git a/man/man1/x2goclient.1 b/man/man1/x2goclient.1 index 5c566e7..bf2360c 100644 --- a/man/man1/x2goclient.1 +++ b/man/man1/x2goclient.1 @@ -102,6 +102,14 @@ If a directory is given, will randomly pick an SVG file inside of it. \*(T<\fB\-\-branding=<svg\-file>\fR\*(T> Use a custom icon (SVG format) for additional branding to replace the default in the lower left corner of X2Go Client's main window. +.SH MISCELLANEOUS OPTIONS +These options change X2Go Client's behavior globally. Some might not be available on all platforms. +.TP +\*(T<\fB\-\-xserver-start-limit=<num>\fR\*(T> (Windows-only) +Limit the X.Org Server start count to at most <num> tries. Default: \fB3\fR. +If \fB<num>\fR is zero or a negative number, no limit is imposed. +The limits for \fB<num>\fR are platform dependent. If the passed value is out of bounds, X2Go Client falls back to the default value. + .SH SESSION PROFILE DEFAULTS You can set certain defaults for session profiles via command line switches using the following options: .TP diff --git a/src/help.cpp b/src/help.cpp index d5343e8..cec2a40 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -162,6 +162,11 @@ help::params_t help::build_params () { ADD_OPT ("--broker-logoutbt", QT_TRANSLATE_NOOP ("Help", "Enables broker logout button.")); ADD_OPT ("--background=<svg-file|dir>", QT_TRANSLATE_NOOP ("Help", "Use a custom/branded background image (SVG format) for X2Go Client's main window. If a directory is given, will randomly pick an SVG file inside of it.")); ADD_OPT ("--branding=<svg-file>", QT_TRANSLATE_NOOP ("Help", "Use a custom icon (SVG format) for additional branding to replace the default in the lower left corner of X2Go Client's main window.")); +#if defined (Q_OS_WIN) + ADD_OPT ("--xserver-start-limit=<num>", QT_TRANSLATE_NOOP ("Help", "Limit the X.Org Server start count to at most <num> tries. Default: \"3\"." NEWLINE + "If <num> is zero or a negative number, no limit is imposed." NEWLINE + "The limits for <num> are platform dependent. If the passed value is out of bounds, X2Go Client falls back to the default value.")); +#endif /* defined (Q_OS_WIN) */ # undef NEWLINE # undef ADD_OPT diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 0e4e18b..0b6ec1f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -172,6 +172,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) xorg=0l; xDisplay=0; x_start_tries_ = 0; + x_start_limit_ = 3; #endif if(X2goSettings::centralSettings()) @@ -7667,6 +7668,30 @@ bool ONMainWindow::parseParameter ( QString param ) OnFile=value; return true; } +#if defined(Q_OS_WIN) + if ("--xserver-start-limit" == setting) { + bool conv_ret = false; + signed long long conv = value.toLongLong (&conv_ret); + + if (conv_ret) { + if (0 >= conv) { + x2goDebug << "Not limiting X.Org Server starts."; + + x_start_limit_ = -1; + { + else { + x_start_limit = conv; + + x2goDebug << "Limiting X.Org Server starts to " << x_start_limit << " tries."; + } + } + else { + x2goDebug << "Conversion for --xserver-start-limit value " << value << " failed; assuming default of 3."; + + x_start_limit = 3; + } + } +#endif /* defined(Q_OS_WIN) */ printError ( param ); return false; @@ -10062,6 +10087,11 @@ void ONMainWindow::startXOrg (std::size_t start_offset) //check connection in slot and launch setWinServerReady waitingForX=0; x_start_tries_ += 1; + + if (0 == x_start_limit_) { + x2goWarningf(9) << "X.Org Server start limit set to invalid value zero!"; + } + QTimer::singleShot(1000, this, SLOT(slotCheckXOrgConnection())); } // #endif @@ -10077,8 +10107,8 @@ void ONMainWindow::slotCheckXOrgConnection() * Process died (crashed, terminated, whatever). We need to restart it, unless we already tried * to do so multiple times unsuccessfully. */ - if (3 < x_start_tries_) { - x2goDebug << "Unable to start X.Org Server for three times, terminating."; + if (x_start_limit_ < x_start_tries_) { + x2goDebug << "Unable to start X.Org Server for " << x_start_limit_ << " times, terminating."; QMessageBox::critical (NULL, QString::null, tr ("X.Org Server did not launch correctly after three tries.\n" @@ -10110,11 +10140,11 @@ void ONMainWindow::slotCheckXOrgConnection() if (waitingForX > 10) { /* - * Timeout reached. If we tried starting the X.Org Server less than three times, + * Timeout reached. If we tried starting the X.Org Server less times than the limit, * continue doing so (with a higher DISPLAY value). * Otherwise error out. */ - if (3 >= x_start_tries_) { + if (x_start_limit_ >= x_start_tries_) { /* * Server might still be running here, but deleting the QProcess object * should kill it. diff --git a/src/onmainwindow.h b/src/onmainwindow.h index d979c75..dad4f1f 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -877,6 +877,7 @@ private: QString xorgHeight; int waitingForX; std::size_t x_start_tries_; + std::ssize_t x_start_limit_; QRect dispGeometry; #endif -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git