Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: remoting/host/wts_session_process_launcher_win.cc

Issue 10106013: Chromoting: stopping the service if the host ID is permanently not recognized by the could. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Exiting host cleanly + CR feedback. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/wts_session_process_launcher_win.cc
diff --git a/remoting/host/wts_session_process_launcher_win.cc b/remoting/host/wts_session_process_launcher_win.cc
index eced4f5cfa6c4602967bb8b924a5dd1df893b782..309fa18d3b74279693ce41c0304490edbf9ebf46 100644
--- a/remoting/host/wts_session_process_launcher_win.cc
+++ b/remoting/host/wts_session_process_launcher_win.cc
@@ -26,7 +26,7 @@
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
-
+#include "remoting/host/constants.h"
#include "remoting/host/chromoting_messages.h"
#include "remoting/host/sas_injector.h"
#include "remoting/host/wts_console_monitor_win.h"
@@ -36,9 +36,12 @@ using base::TimeDelta;
namespace {
-// The exit code returned by the host process when its configuration is not
-// valid.
-const int kInvalidHostConfigurationExitCode = 1;
+// The range of host exit codes that should be interpreted as a permanent error
+// condition.
+enum {
+ kHostPermanentErrorMin = remoting::kInvalidHostConfigurationExitCode,
Sergey Ulanov 2012/04/17 20:01:25 maybe move this to constants.h to make sure we don
alexeypa (please no reviews) 2012/04/17 20:28:08 Done.
+ kHostPermanentErrorMax = remoting::kInvalidOauthCredentialsExitCode
+};
// The minimum and maximum delays between attempts to inject host process into
// a session.
@@ -350,9 +353,11 @@ void WtsSessionProcessLauncher::OnObjectSignaled(HANDLE object) {
// Stop trying to restart the host if its process exited due to
// misconfiguration.
- DWORD exit_code;
- bool stop_trying = GetExitCodeProcess(process_.handle(), &exit_code) &&
- exit_code == kInvalidHostConfigurationExitCode;
+ int exit_code;
+ bool stop_trying =
+ base::WaitForExitCodeWithTimeout(process_.handle(), &exit_code, 0) &&
+ kHostPermanentErrorMin <= exit_code &&
+ exit_code <= kHostPermanentErrorMax;
// The host process has been terminated for some reason. The handle can now be
// closed.

Powered by Google App Engine
This is Rietveld 408576698