This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient.
commit 40b7fda9a8149b1ff3fd3bb44c7e1b0626e9f93a Author: Mihai Moldovan <io...@ionic.de> Date: Wed Oct 26 18:01:52 2016 +0200 src/onmainwindow.cpp: add listening-check loop to the Windows-specific code of startSshd (). --- debian/changelog | 2 ++ src/onmainwindow.cpp | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index a719ab5..65ff80e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -459,6 +459,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium uses other means of starting the daemon. - src/onmainwindow.cpp: add comment to last all-in listening check in startSshd (). + - src/onmainwindow.cpp: add listening-check loop to the Windows-specific + code of startSshd (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 9dbe555..77c37db 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -10570,20 +10570,37 @@ bool ONMainWindow::startSshd() ZeroMemory ( &sshd, sizeof ( sshd ) ); si.lpDesktop=desktop; si.cb = sizeof ( si ); - CreateProcessA ( NULL, // No module name (use command line) - ( LPSTR ) strm.str().c_str(), // Command line - NULL, // Process handle not inheritable - NULL, // Thread handle not inheritable - TRUE, // Set handle inheritance to FALSE - 0/*CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP*/, - //creation flags - NULL, // Use parent's environment block - clientdir.c_str(), // Starting directory - &si, // Pointer to STARTUPINFO structure - &sshd );// Pointer to PROCESS_INFORMATION structure - /* FIXME: test successful SSH daemon startup */ + const BOOL ret = CreateProcessA ( NULL, // No module name (use command line) + ( LPSTR ) strm.str().c_str(), // Command line + NULL, // Process handle not inheritable + NULL, // Thread handle not inheritable + TRUE, // Set handle inheritance to FALSE + 0/*CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP*/, + //creation flags + NULL, // Use parent's environment block + clientdir.c_str(), // Starting directory + &si, // Pointer to STARTUPINFO structure + &sshd );// Pointer to PROCESS_INFORMATION structure + + /* Test successful SSH daemon startup for at most 5 seconds. */ + if (ret) { + QTime sleep_time = QTime::currentTime ().addSecs (5); + + while (QTime::currentTime () < sleep_time) { + if (isServerRunning (clientSshPort.toInt ())) { + winSshdStarted = true; + + break; + } + + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); + } + } + else { + winSshdStarted = false; + } + delete []desktop; - winSshdStarted=true; #else // defined (Q_OS_WIN) sshd=new QProcess ( this ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git _______________________________________________ x2go-commits mailing list x2go-commits@lists.x2go.org http://lists.x2go.org/listinfo/x2go-commits