OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 } | 847 } |
848 break; | 848 break; |
849 | 849 |
850 case SSL_ERROR_WANT_WRITE: | 850 case SSL_ERROR_WANT_WRITE: |
851 LOG(LS_VERBOSE) << " -- error want write"; | 851 LOG(LS_VERBOSE) << " -- error want write"; |
852 break; | 852 break; |
853 | 853 |
854 case SSL_ERROR_ZERO_RETURN: | 854 case SSL_ERROR_ZERO_RETURN: |
855 default: | 855 default: |
856 LOG(LS_VERBOSE) << " -- error " << code; | 856 LOG(LS_VERBOSE) << " -- error " << code; |
857 SSLHandshakeError ssl_handshake_err = SSLHandshakeError::ERR_OTHER; | |
858 int err_code = 0; | |
859 if ((err_code = ERR_peek_last_error()) != 0 && | |
honghaiz3
2016/07/22 21:35:26
you could do
int err_code = ERR_peek_last_error();
Zhi Huang
2016/07/25 17:24:28
Done.
| |
860 ERR_GET_REASON(err_code) == SSL_R_NO_SHARED_CIPHER) { | |
861 ssl_handshake_err = SSLHandshakeError::ERR_INCOMPATIBLE_CIPHERSUITE; | |
862 } | |
863 SignalSSLHandshakeError(ssl_handshake_err); | |
857 return (ssl_error != 0) ? ssl_error : -1; | 864 return (ssl_error != 0) ? ssl_error : -1; |
858 } | 865 } |
859 | 866 |
860 return 0; | 867 return 0; |
861 } | 868 } |
862 | 869 |
863 void OpenSSLStreamAdapter::Error(const char* context, int err, bool signal) { | 870 void OpenSSLStreamAdapter::Error(const char* context, int err, bool signal) { |
864 LOG(LS_WARNING) << "OpenSSLStreamAdapter::Error(" | 871 LOG(LS_WARNING) << "OpenSSLStreamAdapter::Error(" |
865 << context << ", " << err << ")"; | 872 << context << ", " << err << ")"; |
866 state_ = SSL_ERROR; | 873 state_ = SSL_ERROR; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1219 return true; | 1226 return true; |
1220 } | 1227 } |
1221 } | 1228 } |
1222 | 1229 |
1223 return false; | 1230 return false; |
1224 } | 1231 } |
1225 | 1232 |
1226 } // namespace rtc | 1233 } // namespace rtc |
1227 | 1234 |
1228 #endif // HAVE_OPENSSL_SSL_H | 1235 #endif // HAVE_OPENSSL_SSL_H |
OLD | NEW |