| OLD | NEW |
| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 break; | 169 break; |
| 170 } | 170 } |
| 171 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); | 171 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); |
| 172 return rv; | 172 return rv; |
| 173 } | 173 } |
| 174 | 174 |
| 175 int SOCKS5ClientSocket::DoResolveHost() { | 175 int SOCKS5ClientSocket::DoResolveHost() { |
| 176 DCHECK_EQ(kEndPointUnresolved, address_type_); | 176 DCHECK_EQ(kEndPointUnresolved, address_type_); |
| 177 | 177 |
| 178 next_state_ = STATE_RESOLVE_HOST_COMPLETE; | 178 next_state_ = STATE_RESOLVE_HOST_COMPLETE; |
| 179 return host_resolver_.Resolve(host_request_info_, &addresses_, &io_callback_); | 179 return host_resolver_.Resolve( |
| 180 NULL, host_request_info_, &addresses_, &io_callback_); |
| 180 } | 181 } |
| 181 | 182 |
| 182 int SOCKS5ClientSocket::DoResolveHostComplete(int result) { | 183 int SOCKS5ClientSocket::DoResolveHostComplete(int result) { |
| 183 DCHECK_EQ(kEndPointUnresolved, address_type_); | 184 DCHECK_EQ(kEndPointUnresolved, address_type_); |
| 184 | 185 |
| 185 bool ok = (result == OK); | 186 bool ok = (result == OK); |
| 186 next_state_ = STATE_GREET_WRITE; | 187 next_state_ = STATE_GREET_WRITE; |
| 187 if (ok) { | 188 if (ok) { |
| 188 DCHECK(addresses_.head()); | 189 DCHECK(addresses_.head()); |
| 189 struct sockaddr* host_info = addresses_.head()->ai_addr; | 190 struct sockaddr* host_info = addresses_.head()->ai_addr; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 422 |
| 422 #if defined(OS_LINUX) | 423 #if defined(OS_LINUX) |
| 423 int SOCKS5ClientSocket::GetPeerName(struct sockaddr* name, | 424 int SOCKS5ClientSocket::GetPeerName(struct sockaddr* name, |
| 424 socklen_t* namelen) { | 425 socklen_t* namelen) { |
| 425 return transport_->GetPeerName(name, namelen); | 426 return transport_->GetPeerName(name, namelen); |
| 426 } | 427 } |
| 427 #endif | 428 #endif |
| 428 | 429 |
| 429 } // namespace net | 430 } // namespace net |
| 430 | 431 |
| OLD | NEW |