| OLD | NEW |
| 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/ssl_client_socket_impl.h" | 5 #include "net/socket/ssl_client_socket_impl.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 | 1304 |
| 1305 void SSLClientSocketImpl::OnHandshakeIOComplete(int result) { | 1305 void SSLClientSocketImpl::OnHandshakeIOComplete(int result) { |
| 1306 int rv = DoHandshakeLoop(result); | 1306 int rv = DoHandshakeLoop(result); |
| 1307 if (rv != ERR_IO_PENDING) { | 1307 if (rv != ERR_IO_PENDING) { |
| 1308 LogConnectEndEvent(rv); | 1308 LogConnectEndEvent(rv); |
| 1309 DoConnectCallback(rv); | 1309 DoConnectCallback(rv); |
| 1310 } | 1310 } |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 int SSLClientSocketImpl::DoHandshakeLoop(int last_io_result) { | 1313 int SSLClientSocketImpl::DoHandshakeLoop(int last_io_result) { |
| 1314 TRACE_EVENT0(kNetTracingCategory, "SSLClientSocketImpl::DoHandshakeLoop"); | 1314 TRACE_EVENT1("net", "SSLClientSocketImpl::DoHandshakeLoop", "host", |
| 1315 host_and_port_.host()); |
| 1315 int rv = last_io_result; | 1316 int rv = last_io_result; |
| 1316 do { | 1317 do { |
| 1317 // Default to STATE_NONE for next state. | 1318 // Default to STATE_NONE for next state. |
| 1318 // (This is a quirk carried over from the windows | 1319 // (This is a quirk carried over from the windows |
| 1319 // implementation. It makes reading the logs a bit harder.) | 1320 // implementation. It makes reading the logs a bit harder.) |
| 1320 // State handlers can and often do call GotoState just | 1321 // State handlers can and often do call GotoState just |
| 1321 // to stay in the current state. | 1322 // to stay in the current state. |
| 1322 State state = next_handshake_state_; | 1323 State state = next_handshake_state_; |
| 1323 next_handshake_state_ = STATE_NONE; | 1324 next_handshake_state_ = STATE_NONE; |
| 1324 switch (state) { | 1325 switch (state) { |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1979 if (ERR_GET_REASON(info->error_code) == SSL_R_TLSV1_ALERT_ACCESS_DENIED && | 1980 if (ERR_GET_REASON(info->error_code) == SSL_R_TLSV1_ALERT_ACCESS_DENIED && |
| 1980 !certificate_requested_) { | 1981 !certificate_requested_) { |
| 1981 net_error = ERR_SSL_PROTOCOL_ERROR; | 1982 net_error = ERR_SSL_PROTOCOL_ERROR; |
| 1982 } | 1983 } |
| 1983 } | 1984 } |
| 1984 | 1985 |
| 1985 return net_error; | 1986 return net_error; |
| 1986 } | 1987 } |
| 1987 | 1988 |
| 1988 } // namespace net | 1989 } // namespace net |
| OLD | NEW |