From: discomfitor Date: Fri, 17 Sep 2010 17:22:59 +0000 (+0000) Subject: simplify error conditions and output errrors on failure X-Git-Tag: 2.0_alpha~194^2~713 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f8e075f2256663c5794a7899351059666ea4234;p=framework%2Fuifw%2Fecore.git simplify error conditions and output errrors on failure git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@52378 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c index 200ee3f..fc87bd5 100644 --- a/src/lib/ecore_con/ecore_con_ssl.c +++ b/src/lib/ecore_con/ecore_con_ssl.c @@ -353,14 +353,14 @@ _ecore_con_ssl_server_init_gnutls(Ecore_Con_Server *svr) (ret == GNUTLS_E_INTERRUPTED)) continue; - _ecore_con_ssl_server_shutdown_gnutls(svr); - return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; + goto error; } return ECORE_CON_SSL_ERROR_NONE; error: - ERR("gnutls returned with error: %s", gnutls_strerror(ret)); + ERR("gnutls returned with error: %s - %s", gnutls_strerror_name(ret), gnutls_strerror(ret)); + _ecore_con_ssl_server_shutdown_gnutls(svr); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; } @@ -568,14 +568,15 @@ _ecore_con_ssl_client_init_gnutls(Ecore_Con_Client *cl) (ret == GNUTLS_E_INTERRUPTED)) continue; - _ecore_con_ssl_client_shutdown_gnutls(cl); - return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; + goto error; } /* TODO: add cert verification support */ return ECORE_CON_SSL_ERROR_NONE; + error: - ERR("gnutls returned with error: %s", gnutls_strerror(ret)); + ERR("gnutls returned with error: %s - %s", gnutls_strerror_name(ret), gnutls_strerror(ret)); + _ecore_con_ssl_client_shutdown_gnutls(cl); return ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED; }