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

Side by Side Diff: net/socket/tcp_client_socket_win.cc

Issue 10491007: fixed issue 128383 - replace GetPeerAddress(AddressList* address) with GetPeerAddress(IPEndPoint* a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix according to review Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/tcp_client_socket_win.h ('k') | net/socket/tcp_server_socket_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/tcp_client_socket_win.h" 5 #include "net/socket/tcp_client_socket_win.h"
6 6
7 #include <mstcpip.h> 7 #include <mstcpip.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 char c; 628 char c;
629 int rv = recv(socket_, &c, 1, MSG_PEEK); 629 int rv = recv(socket_, &c, 1, MSG_PEEK);
630 if (rv >= 0) 630 if (rv >= 0)
631 return false; 631 return false;
632 if (WSAGetLastError() != WSAEWOULDBLOCK) 632 if (WSAGetLastError() != WSAEWOULDBLOCK)
633 return false; 633 return false;
634 634
635 return true; 635 return true;
636 } 636 }
637 637
638 int TCPClientSocketWin::GetPeerAddress(AddressList* address) const { 638 int TCPClientSocketWin::GetPeerAddress(IPEndPoint* address) const {
639 DCHECK(CalledOnValidThread()); 639 DCHECK(CalledOnValidThread());
640 DCHECK(address); 640 DCHECK(address);
641 if (!IsConnected()) 641 if (!IsConnected())
642 return ERR_SOCKET_NOT_CONNECTED; 642 return ERR_SOCKET_NOT_CONNECTED;
643 *address = AddressList(addresses_[current_address_index_]); 643 *address = addresses_[current_address_index_];
644 return OK; 644 return OK;
645 } 645 }
646 646
647 int TCPClientSocketWin::GetLocalAddress(IPEndPoint* address) const { 647 int TCPClientSocketWin::GetLocalAddress(IPEndPoint* address) const {
648 DCHECK(CalledOnValidThread()); 648 DCHECK(CalledOnValidThread());
649 DCHECK(address); 649 DCHECK(address);
650 if (!IsConnected()) 650 if (!IsConnected())
651 return ERR_SOCKET_NOT_CONNECTED; 651 return ERR_SOCKET_NOT_CONNECTED;
652 652
653 struct sockaddr_storage addr_storage; 653 struct sockaddr_storage addr_storage;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 use_history_.set_was_used_to_convey_data(); 927 use_history_.set_was_used_to_convey_data();
928 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, num_bytes, 928 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, num_bytes,
929 core_->write_buffer_.buf); 929 core_->write_buffer_.buf);
930 } 930 }
931 } 931 }
932 core_->write_iobuffer_ = NULL; 932 core_->write_iobuffer_ = NULL;
933 DoWriteCallback(rv); 933 DoWriteCallback(rv);
934 } 934 }
935 935
936 } // namespace net 936 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_client_socket_win.h ('k') | net/socket/tcp_server_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698