From a0754d68b29b013fbeb833a0658e26bf2d562b95 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Thu, 9 Feb 2012 19:08:08 +0000 Subject: Revert 121055 - Remove BeginSessionDeprecated. Once M17 is released no clients will need BeginSession message from the host, so it's safe to remove it. BUG=104670 Review URL: https://chromiumcodereview.appspot.com/9243021 TBR=sergeyu@chromium.org Review URL: https://chromiumcodereview.appspot.com/9369037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121261 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/protocol/client_control_dispatcher.cc | 11 +++++++++-- remoting/protocol/host_control_dispatcher.cc | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'remoting/protocol') diff --git a/remoting/protocol/client_control_dispatcher.cc b/remoting/protocol/client_control_dispatcher.cc index 79ae7be..54e1d1c 100644 --- a/remoting/protocol/client_control_dispatcher.cc +++ b/remoting/protocol/client_control_dispatcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 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. @@ -37,8 +37,15 @@ void ClientControlDispatcher::OnInitialized() { void ClientControlDispatcher::OnMessageReceived( ControlMessage* message, const base::Closure& done_task) { DCHECK(client_stub_); + base::ScopedClosureRunner done_runner(done_task); - LOG(WARNING) << "Unknown control message received."; + + if (message->has_begin_session_deprecated()) { + // Host sends legacy BeginSession message for compatibility with + // older clients. Ignore it without warning. + } else { + LOG(WARNING) << "Unknown control message received."; + } } } // namespace protocol diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc index a51058c..43f4f8f 100644 --- a/remoting/protocol/host_control_dispatcher.cc +++ b/remoting/protocol/host_control_dispatcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 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. @@ -30,6 +30,13 @@ void HostControlDispatcher::OnInitialized() { reader_.Init(channel(), base::Bind( &HostControlDispatcher::OnMessageReceived, base::Unretained(this))); writer_->Init(channel(), BufferedSocketWriter::WriteFailedCallback()); + + // Write legacy BeginSession message. + // TODO(sergeyu): Remove it. See http://crbug.com/104670 . + protocol::ControlMessage message; + message.mutable_begin_session_deprecated()->mutable_login_status()-> + set_success(true); + writer_->Write(SerializeAndFrameMessage(message), base::Closure()); } void HostControlDispatcher::OnMessageReceived( -- cgit v1.1