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

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

Issue 199048: Add methods for setting socket buffers to the Socket (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/socks5_client_socket.h ('k') | net/socket/socks_client_socket.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/socks5_client_socket.h" 5 #include "net/socket/socks5_client_socket.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <ws2tcpip.h> 10 #include <ws2tcpip.h>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // SOCKS handshake is complete. 95 // SOCKS handshake is complete.
96 int SOCKS5ClientSocket::Write(IOBuffer* buf, int buf_len, 96 int SOCKS5ClientSocket::Write(IOBuffer* buf, int buf_len,
97 CompletionCallback* callback) { 97 CompletionCallback* callback) {
98 DCHECK(completed_handshake_); 98 DCHECK(completed_handshake_);
99 DCHECK_EQ(STATE_NONE, next_state_); 99 DCHECK_EQ(STATE_NONE, next_state_);
100 DCHECK(!user_callback_); 100 DCHECK(!user_callback_);
101 101
102 return transport_->Write(buf, buf_len, callback); 102 return transport_->Write(buf, buf_len, callback);
103 } 103 }
104 104
105 bool SOCKS5ClientSocket::SetReceiveBufferSize(int32 size) {
106 return transport_->SetReceiveBufferSize(size);
107 }
108
109 bool SOCKS5ClientSocket::SetSendBufferSize(int32 size) {
110 return transport_->SetSendBufferSize(size);
111 }
112
105 void SOCKS5ClientSocket::DoCallback(int result) { 113 void SOCKS5ClientSocket::DoCallback(int result) {
106 DCHECK_NE(ERR_IO_PENDING, result); 114 DCHECK_NE(ERR_IO_PENDING, result);
107 DCHECK(user_callback_); 115 DCHECK(user_callback_);
108 116
109 // Since Run() may result in Read being called, 117 // Since Run() may result in Read being called,
110 // clear user_callback_ up front. 118 // clear user_callback_ up front.
111 CompletionCallback* c = user_callback_; 119 CompletionCallback* c = user_callback_;
112 user_callback_ = NULL; 120 user_callback_ = NULL;
113 DLOG(INFO) << "Finished setting up SOCKSv5 handshake"; 121 DLOG(INFO) << "Finished setting up SOCKSv5 handshake";
114 c->Run(result); 122 c->Run(result);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 429 }
422 430
423 #if defined(OS_LINUX) 431 #if defined(OS_LINUX)
424 int SOCKS5ClientSocket::GetPeerName(struct sockaddr* name, 432 int SOCKS5ClientSocket::GetPeerName(struct sockaddr* name,
425 socklen_t* namelen) { 433 socklen_t* namelen) {
426 return transport_->GetPeerName(name, namelen); 434 return transport_->GetPeerName(name, namelen);
427 } 435 }
428 #endif 436 #endif
429 437
430 } // namespace net 438 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks5_client_socket.h ('k') | net/socket/socks_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698