| Index: blimp/net/client_connection_manager.cc
|
| diff --git a/blimp/net/client_connection_manager.cc b/blimp/net/client_connection_manager.cc
|
| index c8238e4ba70f318330567a20753566e81ba04e20..06266965d6e1e9b5fda8ef9993069ee4bb1caf44 100644
|
| --- a/blimp/net/client_connection_manager.cc
|
| +++ b/blimp/net/client_connection_manager.cc
|
| @@ -5,7 +5,11 @@
|
| #include "blimp/net/client_connection_manager.h"
|
|
|
| #include "base/logging.h"
|
| +#include "blimp/common/create_blimp_message.h"
|
| +#include "blimp/common/proto/blimp_message.pb.h"
|
| +#include "blimp/common/protocol_version.h"
|
| #include "blimp/net/blimp_connection.h"
|
| +#include "blimp/net/blimp_message_processor.h"
|
| #include "blimp/net/blimp_transport.h"
|
| #include "blimp/net/connection_handler.h"
|
| #include "net/base/net_errors.h"
|
| @@ -48,7 +52,9 @@ void ClientConnectionManager::OnConnectResult(int transport_index, int result) {
|
| DCHECK_NE(result, net::ERR_IO_PENDING);
|
| const auto& transport = transports_[transport_index];
|
| if (result == net::OK) {
|
| - connection_handler_->HandleConnection(transport->TakeConnection());
|
| + scoped_ptr<BlimpConnection> connection = transport->TakeConnection();
|
| + SendAuthenticationMessage(connection.get());
|
| + connection_handler_->HandleConnection(std::move(connection));
|
| } else {
|
| DVLOG(1) << "Transport " << transport->GetName()
|
| << " failed to connect:" << net::ErrorToString(result);
|
| @@ -56,4 +62,13 @@ void ClientConnectionManager::OnConnectResult(int transport_index, int result) {
|
| }
|
| }
|
|
|
| +void ClientConnectionManager::SendAuthenticationMessage(
|
| + BlimpConnection* connection) {
|
| + // TODO(haibinlu): get client token.
|
| + const char* client_token = "";
|
| + connection->GetOutgoingMessageProcessor()->ProcessMessage(
|
| + CreateStartConnectionMessage(client_token, kProtocolVersion),
|
| + net::CompletionCallback());
|
| +}
|
| +
|
| } // namespace blimp
|
|
|