| Index: content/browser/renderer_host/p2p/socket_host_tcp_server.cc
|
| diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
|
| index 4c7891a4d88419b612c153a4fde5039874e12bb8..e5d34013c8b50774e48b7f98b7e3ccfadddb1336 100644
|
| --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
|
| +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 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.
|
|
|
| @@ -12,7 +12,6 @@
|
| #include "net/base/address_list.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/base/net_util.h"
|
| -#include "net/base/sys_addrinfo.h"
|
| #include "net/socket/stream_socket.h"
|
|
|
| namespace {
|
| @@ -95,19 +94,17 @@ void P2PSocketHostTcpServer::HandleAcceptResult(int result) {
|
| return;
|
| }
|
|
|
| - net::IPEndPoint address;
|
| net::AddressList addr_list;
|
| - if (accept_socket_->GetPeerAddress(&addr_list) != net::OK ||
|
| - !address.FromSockAddr(addr_list.head()->ai_addr,
|
| - addr_list.head()->ai_addrlen)) {
|
| + if (accept_socket_->GetPeerAddress(&addr_list) != net::OK) {
|
| LOG(ERROR) << "Failed to get address of an accepted socket.";
|
| accept_socket_.reset();
|
| return;
|
| }
|
| + const net::IPEndPoint& address = addr_list.front();
|
| AcceptedSocketsMap::iterator it = accepted_sockets_.find(address);
|
| - if (it != accepted_sockets_.end()) {
|
| + if (it != accepted_sockets_.end())
|
| delete it->second;
|
| - }
|
| +
|
| accepted_sockets_[address] = accept_socket_.release();
|
| message_sender_->Send(
|
| new P2PMsg_OnIncomingTcpConnection(routing_id_, id_, address));
|
|
|