OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/openssl_util.h" |
| 6 |
| 7 #include <openssl/err.h> |
| 8 |
| 9 #include "base/logging.h" |
| 10 |
| 11 namespace base { |
| 12 |
| 13 void ClearERRStack() { |
| 14 if (logging::DEBUG_MODE && VLOG_IS_ON(1)) { |
| 15 int error_num = ERR_get_error(); |
| 16 if (error_num == 0) |
| 17 return; |
| 18 |
| 19 DVLOG(1) << "OpenSSL ERR_get_error stack:"; |
| 20 char buf[140]; |
| 21 do { |
| 22 ERR_error_string_n(error_num, buf, arraysize(buf)); |
| 23 DVLOG(1) << "\t" << error_num << ": " << buf; |
| 24 error_num = ERR_get_error(); |
| 25 } while (error_num != 0); |
| 26 } else { |
| 27 ERR_clear_error(); |
| 28 } |
| 29 } |
| 30 |
| 31 } // namespace base |
OLD | NEW |