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 int err_code = ERR_peek_last_error(); | |
858 int err_reason = 0; | |
Zhi Huang
2016/07/27 21:04:14
I can leave a comment, like "Use 0 to represent un
| |
859 if (err_code != 0 && ERR_GET_REASON(err_code) == SSL_R_NO_SHARED_CIPHER) { | |
860 err_reason = SSL_R_NO_SHARED_CIPHER; | |
861 } | |
862 SignalSSLHandshakeError(err_reason); | |
honghaiz3
2016/07/29 15:49:54
Should this just be
int err_reason = ERR_GET_REAS
honghaiz3
2016/08/01 17:19:19
If you only want to log the error SSL_R_NO_SHARED_
| |
857 return (ssl_error != 0) ? ssl_error : -1; | 863 return (ssl_error != 0) ? ssl_error : -1; |
858 } | 864 } |
859 | 865 |
860 return 0; | 866 return 0; |
861 } | 867 } |
862 | 868 |
863 void OpenSSLStreamAdapter::Error(const char* context, int err, bool signal) { | 869 void OpenSSLStreamAdapter::Error(const char* context, int err, bool signal) { |
864 LOG(LS_WARNING) << "OpenSSLStreamAdapter::Error(" | 870 LOG(LS_WARNING) << "OpenSSLStreamAdapter::Error(" |
865 << context << ", " << err << ")"; | 871 << context << ", " << err << ")"; |
866 state_ = SSL_ERROR; | 872 state_ = SSL_ERROR; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1219 return true; | 1225 return true; |
1220 } | 1226 } |
1221 } | 1227 } |
1222 | 1228 |
1223 return false; | 1229 return false; |
1224 } | 1230 } |
1225 | 1231 |
1226 } // namespace rtc | 1232 } // namespace rtc |
1227 | 1233 |
1228 #endif // HAVE_OPENSSL_SSL_H | 1234 #endif // HAVE_OPENSSL_SSL_H |
OLD | NEW |