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

Unified Diff: remoting/host/client_session.cc

Issue 10409021: Handle disconnection events properly for unauthenicated clients. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« remoting/host/client_session.h ('K') | « remoting/host/client_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 7db5498373ec3b3098c19f3a2db58323c86a33c9..180ecc8b11b4c6a031a9619d32b9f177393a3b48 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -21,6 +21,7 @@ ClientSession::ClientSession(
: event_handler_(event_handler),
connection_(connection.Pass()),
client_jid_(connection_->session()->jid()),
+ is_authenticated_(false),
host_event_stub_(host_event_stub),
input_tracker_(host_event_stub_),
remote_input_filter_(&input_tracker_),
@@ -90,6 +91,7 @@ void ClientSession::OnConnectionAuthenticated(
protocol::ConnectionToClient* connection) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(connection_.get(), connection);
+ is_authenticated_ = true;
auth_input_filter_.set_input_stub(&disable_input_filter_);
event_handler_->OnSessionAuthenticated(this);
}
@@ -107,7 +109,7 @@ void ClientSession::OnConnectionClosed(
protocol::ErrorCode error) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(connection_.get(), connection);
- if (!auth_input_filter_.input_stub())
+ if (!is_authenticated_)
event_handler_->OnSessionAuthenticationFailed(this);
auth_input_filter_.set_input_stub(NULL);
« remoting/host/client_session.h ('K') | « remoting/host/client_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698