From 92388951b976a0fb73ad180924b4ed5688fe3346 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Wed, 22 Sep 2010 22:33:02 +0000 Subject: [PATCH] better openssl error handlers git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@52607 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_con/ecore_con_ssl.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c index ce22b5e..713ec10 100644 --- a/src/lib/ecore_con/ecore_con_ssl.c +++ b/src/lib/ecore_con/ecore_con_ssl.c @@ -854,7 +854,14 @@ error: ERR("openssl error: dh_params could not generate a safe prime!"); } else - ERR("openssl error: %s", ERR_reason_error_string(ERR_get_error())); + do + { + unsigned long err; + + err = ERR_get_error(); + if (!err) break; + ERR("openssl error: %s", ERR_reason_error_string(err)); + } while (1); _ecore_con_ssl_server_shutdown_openssl(svr); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } @@ -880,7 +887,14 @@ _ecore_con_ssl_server_init_openssl(Ecore_Con_Server *svr) return ECORE_CON_SSL_ERROR_NONE; error: - ERR("openssl error: %s", ERR_reason_error_string(ERR_get_error())); + do + { + unsigned long err; + + err = ERR_get_error(); + if (!err) break; + ERR("openssl error: %s", ERR_reason_error_string(err)); + } while (1); _ecore_con_ssl_server_shutdown_openssl(svr); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } @@ -1079,7 +1093,14 @@ _ecore_con_ssl_client_init_openssl(Ecore_Con_Client *cl) return ECORE_CON_SSL_ERROR_NONE; error: - ERR("openssl error: %s", ERR_reason_error_string(ERR_get_error())); + do + { + unsigned long err; + + err = ERR_get_error(); + if (!err) break; + ERR("openssl error: %s", ERR_reason_error_string(err)); + } while (1); _ecore_con_ssl_client_shutdown_openssl(cl); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } -- 2.7.4