summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/p2p
diff options
context:
space:
mode:
authormallinath@chromium.org <mallinath@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-20 01:35:37 +0000
committermallinath@chromium.org <mallinath@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-20 01:35:37 +0000
commite55827e5975b735dbd0e8e27691b2300205afb84 (patch)
treed3cf0470a70b8890b9eedcc6feffe9087dad0ba4 /content/browser/renderer_host/p2p
parent6cb6ca9a25801e9cb789de7507fbad061a0d1ad8 (diff)
downloadchromium_src-e55827e5975b735dbd0e8e27691b2300205afb84.zip
chromium_src-e55827e5975b735dbd0e8e27691b2300205afb84.tar.gz
chromium_src-e55827e5975b735dbd0e8e27691b2300205afb84.tar.bz2
P2PSocketHostTcp::Init method calls SetSendBufferSize after net::TCPClientSocket object creation. After the object creation TCPClientSocket::socket_ is pointing to invalid address where as bound_socket_ has the right value. The socket_ will have right value of socket fd once Connect method is called for the socket object.
Review URL: http://codereview.chromium.org/9729011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/p2p')
-rw-r--r--content/browser/renderer_host/p2p/socket_host_tcp.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc
index 755cd0d..6bbe2d1 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.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.
@@ -59,9 +59,6 @@ bool P2PSocketHostTcp::Init(const net::IPEndPoint& local_address,
}
socket_.reset(tcp_socket.release());
- if (socket_->SetSendBufferSize(kMaxSendBufferSize))
- LOG(WARNING) << "Failed to set send buffer size for TCP socket.";
-
int result = socket_->Connect(
base::Bind(&P2PSocketHostTcp::OnConnected, base::Unretained(this)));
if (result != net::ERR_IO_PENDING) {
@@ -75,8 +72,9 @@ void P2PSocketHostTcp::OnError() {
socket_.reset();
if (state_ == STATE_UNINITIALIZED || state_ == STATE_CONNECTING ||
- state_ == STATE_OPEN)
+ state_ == STATE_OPEN) {
message_sender_->Send(new P2PMsg_OnError(routing_id_, id_));
+ }
state_ = STATE_ERROR;
}
@@ -90,6 +88,10 @@ void P2PSocketHostTcp::OnConnected(int result) {
return;
}
+ if (socket_->SetSendBufferSize(kMaxSendBufferSize)) {
+ LOG(WARNING) << "Failed to set send buffer size for TCP socket.";
+ }
+
net::IPEndPoint address;
result = socket_->GetLocalAddress(&address);
if (result < 0) {