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

Unified Diff: remoting/protocol/host_message_dispatcher.cc

Issue 6711033: A new authenticated connection evicts an old one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove redundant member of HostMessageDispatcher. Created 9 years, 9 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/protocol/host_message_dispatcher.cc
diff --git a/remoting/protocol/host_message_dispatcher.cc b/remoting/protocol/host_message_dispatcher.cc
index f4391a7f6525fbee8c78dd529cd7c15e487ccfa5..9b1ee28cb9809743c8a0771a059743e3fe0cdfd3 100644
--- a/remoting/protocol/host_message_dispatcher.cc
+++ b/remoting/protocol/host_message_dispatcher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,7 @@
#include "remoting/proto/control.pb.h"
#include "remoting/proto/event.pb.h"
#include "remoting/proto/internal.pb.h"
+#include "remoting/protocol/connection_to_client.h"
#include "remoting/protocol/host_message_dispatcher.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_stub.h"
@@ -48,25 +49,22 @@ void HostMessageDispatcher::Initialize(
void HostMessageDispatcher::OnControlMessageReceived(
ControlMessage* message, Task* done_task) {
+ // BeginSessionRequest is always allowed.
+ if (message->has_begin_session_request()) {
+ host_stub_->BeginSessionRequest(
+ &message->begin_session_request().credentials(), done_task);
+ return;
+ }
if (!host_stub_->authenticated()) {
- // When the client has not authenticated with the host, we restrict the
- // control messages that we support.
- if (message->has_begin_session_request()) {
- host_stub_->BeginSessionRequest(
- &message->begin_session_request().credentials(), done_task);
- return;
- } else {
- LOG(WARNING) << "Invalid control message received "
- << "(client not authenticated).";
- }
+ // When the client has not authenticated with the host, no other messages
+ // are allowed.
+ LOG(WARNING) << "Invalid control message received "
+ << "(client not authenticated).";
} else {
// TODO(sergeyu): Add message validation.
if (message->has_suggest_resolution()) {
host_stub_->SuggestResolution(&message->suggest_resolution(), done_task);
return;
- } else if (message->has_begin_session_request()) {
- LOG(WARNING) << "BeginSessionRequest sent after client already "
- << "authorized.";
} else {
LOG(WARNING) << "Invalid control message received.";
}

Powered by Google App Engine
This is Rietveld 408576698