diff options
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 17 | ||||
-rw-r--r-- | remoting/webapp/client_screen.js | 10 |
2 files changed, 19 insertions, 8 deletions
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 3b98715..6307b44 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -212,7 +212,9 @@ class HostProcess void OnAuthFailed(); - void RejectAuthenticatingClient(); + void OnCurtainModeFailed(); + + void OnRemoteSessionSwitchedToConsole(); // Invoked when the user uses the Disconnect windows to terminate // the sessions, or when the local session is activated in curtain mode. @@ -312,9 +314,9 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context, // Create the platform-specific curtain-mode implementation. // TODO(wez): Create this on the network thread? curtain_ = CurtainMode::Create( - base::Bind(&HostProcess::OnDisconnectRequested, + base::Bind(&HostProcess::OnRemoteSessionSwitchedToConsole, base::Unretained(this)), - base::Bind(&HostProcess::RejectAuthenticatingClient, + base::Bind(&HostProcess::OnCurtainModeFailed, base::Unretained(this))); StartOnUiThread(); @@ -934,12 +936,19 @@ void HostProcess::OnAuthFailed() { Shutdown(kInvalidOauthCredentialsExitCode); } -void HostProcess::RejectAuthenticatingClient() { +void HostProcess::OnCurtainModeFailed() { DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); DCHECK(host_); + LOG(ERROR) << "Curtain mode failed to activate. Closing connection."; host_->RejectAuthenticatingClient(); } +void HostProcess::OnRemoteSessionSwitchedToConsole() { + LOG(INFO) << "The remote session switched was to the console." + " Closing connection."; + OnDisconnectRequested(); +} + // Invoked when the user uses the Disconnect windows to terminate // the sessions, or when the local session is activated in curtain mode. void HostProcess::OnDisconnectRequested() { diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js index 3ffb0f8..da8d82a 100644 --- a/remoting/webapp/client_screen.js +++ b/remoting/webapp/client_screen.js @@ -255,10 +255,12 @@ function onClientStateChange_(oldState, newState) { remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); } } else { - // The transition from CONNECTING to CLOSED state may happen - // only with older client plugins. Current version should go the - // FAILED state when connection fails. - showConnectError_(remoting.Error.INVALID_ACCESS_CODE); + // A state transition from CONNECTING -> CLOSED can happen if the host + // closes the connection without an error message instead of accepting it. + // For example, it does this if it fails to activate curtain mode. Since + // there's no way of knowing exactly what went wrong, we rely on server- + // side logs in this case and show a generic error message. + showConnectError_(remoting.Error.UNEXPECTED); } } else if (newState == remoting.ClientSession.State.FAILED) { |