Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "remoting/jingle_glue/ssl_socket_adapter.h" | 5 #include "remoting/jingle_glue/ssl_socket_adapter.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 return net::ERR_UNEXPECTED; | 60 return net::ERR_UNEXPECTED; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // SSLConfigService is not thread-safe, and the default values for SSLConfig | 63 // SSLConfigService is not thread-safe, and the default values for SSLConfig |
| 64 // are correct for us, so we don't use the config service to initialize this | 64 // are correct for us, so we don't use the config service to initialize this |
| 65 // object. | 65 // object. |
| 66 net::SSLConfig ssl_config; | 66 net::SSLConfig ssl_config; |
| 67 transport_socket_->set_addr(talk_base::SocketAddress(hostname_, 0)); | 67 transport_socket_->set_addr(talk_base::SocketAddress(hostname_, 0)); |
| 68 ssl_socket_.reset( | 68 ssl_socket_.reset( |
| 69 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 69 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
| 70 transport_socket_, hostname_.c_str(), ssl_config, | 70 transport_socket_, hostname_.c_str(), /*TODO(rch)*/-1, ssl_config, |
|
wtc
2010/11/11 01:11:35
Isn't 443 better than -1 as a temporary port value
Ryan Hamilton
2010/11/11 18:57:00
Done.
| |
| 71 NULL /* ssl_host_info */)); | 71 NULL /* ssl_host_info */)); |
| 72 | 72 |
| 73 int result = ssl_socket_->Connect(&connected_callback_); | 73 int result = ssl_socket_->Connect(&connected_callback_); |
| 74 | 74 |
| 75 if (result == net::ERR_IO_PENDING || result == net::OK) { | 75 if (result == net::ERR_IO_PENDING || result == net::OK) { |
| 76 return 0; | 76 return 0; |
| 77 } else { | 77 } else { |
| 78 LOG(ERROR) << "Could not start SSL: " << net::ErrorToString(result); | 78 LOG(ERROR) << "Could not start SSL: " << net::ErrorToString(result); |
| 79 return result; | 79 return result; |
| 80 } | 80 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 write_buffer_len_ = buffer_len; | 345 write_buffer_len_ = buffer_len; |
| 346 return; | 346 return; |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 was_used_to_convey_data_ = true; | 349 was_used_to_convey_data_ = true; |
| 350 callback->RunWithParams(Tuple1<int>(result)); | 350 callback->RunWithParams(Tuple1<int>(result)); |
| 351 } | 351 } |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace remoting | 354 } // namespace remoting |
| OLD | NEW |