diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-08 20:56:18 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-08 20:56:18 +0000 |
commit | e1c74da37005ceb7950323ccb85b75ed6fee24d8 (patch) | |
tree | 1ebac403d586619f02a1997aeb6f8630cbae1aff /remoting | |
parent | af397fe364fa74af593faad798c04f0e5b9def27 (diff) | |
download | chromium_src-e1c74da37005ceb7950323ccb85b75ed6fee24d8.zip chromium_src-e1c74da37005ceb7950323ccb85b75ed6fee24d8.tar.gz chromium_src-e1c74da37005ceb7950323ccb85b75ed6fee24d8.tar.bz2 |
Disconnect all clients if IT2Me Host receives a second successful client.
BUG=93997
Review URL: http://codereview.chromium.org/7846009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/chromoting_host.cc | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 46282da..2d578446 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -129,20 +129,11 @@ void ChromotingHost::Shutdown(Task* shutdown_task) { state_ = kStopping; } - // Make sure ScreenRecorder doesn't write to the connection. - if (recorder_.get()) { - recorder_->RemoveAllConnections(); + // Disconnect all of the clients, implicitly stopping the ScreenRecorder. + while (!clients_.empty()) { + OnClientDisconnected(clients_.front()->connection()); } - // Stop all desktop interaction. - desktop_environment_->OnLastDisconnect(); - - // Disconnect the clients. - for (size_t i = 0; i < clients_.size(); i++) { - clients_[i]->Disconnect(); - } - clients_.clear(); - ShutdownNetwork(); } @@ -233,10 +224,6 @@ void ChromotingHost::OnStateChange( it != status_observers_.end(); ++it) { (*it)->OnSignallingDisconnected(); } - // TODO(sergeyu): Don't shutdown the host and let the upper level - // decide what needs to be done when signalling channel is - // disconnected. - Shutdown(NULL); } } @@ -262,13 +249,6 @@ void ChromotingHost::OnIncomingSession( return; } - // If we are running Me2Mom and already have an authenticated client then - // reject the connection immediately. - if (is_it2me_ && AuthenticatedClientsCount() > 0) { - *response = protocol::SessionManager::DECLINE; - return; - } - // Check that the client has access to the host. if (!access_verifier_->VerifyPermissions(session->jid(), session->initiator_token())) { @@ -282,6 +262,16 @@ void ChromotingHost::OnIncomingSession( return; } + // If we are running Me2Mom and already have an authenticated client then + // one of the connections may be an attacker, so both are suspect. + if (is_it2me_ && AuthenticatedClientsCount() > 0) { + *response = protocol::SessionManager::DECLINE; + + // Close existing sessions and shutdown the host. + Shutdown(NULL); + return; + } + // TODO(simonmorris): The resolution is set in the video stream now, // so it doesn't need to be set here. *protocol_config_->mutable_initial_resolution() = |