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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp_server.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get_canonical_name -> canonical_name. iterator to indexing Created 8 years, 7 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: 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));
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp.cc ('k') | content/browser/renderer_host/pepper_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698