Index: remoting/protocol/connection_to_host.cc |
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc |
index 27d2da1cd3fa7784e90cdacb5f3f990cb50c3b74..dd41fd011d7d04709bd5ad0f2152be77b5ccd7fe 100644 |
--- a/remoting/protocol/connection_to_host.cc |
+++ b/remoting/protocol/connection_to_host.cc |
@@ -22,7 +22,8 @@ namespace remoting { |
namespace protocol { |
ConnectionToHost::ConnectionToHost(JingleThread* thread) |
- : thread_(thread), |
+ : client_authenticated_(false), |
+ thread_(thread), |
event_callback_(NULL), |
dispatcher_(new ClientMessageDispatcher()) { |
} |
@@ -184,7 +185,6 @@ void ConnectionToHost::OnSessionStateChange( |
// Initialize reader and writer. |
video_reader_.reset(VideoReader::Create(session_->config())); |
video_reader_->Init(session_, video_stub_); |
- input_stub_.reset(new InputSender(session_->event_channel())); |
host_stub_.reset(new HostControlSender(session_->control_channel())); |
dispatcher_->Initialize(session_.get(), client_stub_); |
event_callback_->OnConnectionOpened(this); |
@@ -196,5 +196,19 @@ void ConnectionToHost::OnSessionStateChange( |
} |
} |
+void ConnectionToHost::OnClientAuthenticated() { |
+ client_authenticated_ = true; |
+ |
+ // Create and enable the input stub now that we're authenticated. |
+ input_stub_.reset(new InputSender(session_->event_channel())); |
+ input_stub_->OnAuthenticated(); |
+ |
+ // Enable control channel stubs. |
+ if (host_stub_.get()) |
+ host_stub_->OnAuthenticated(); |
+ if (client_stub_) |
+ client_stub_->OnAuthenticated(); |
+} |
+ |
} // namespace protocol |
} // namespace remoting |