diff options
Diffstat (limited to 'doc/examples/ex-alert.c')
-rw-r--r-- | doc/examples/ex-alert.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/doc/examples/ex-alert.c b/doc/examples/ex-alert.c index 6bc14562fe..868771a681 100644 --- a/doc/examples/ex-alert.c +++ b/doc/examples/ex-alert.c @@ -14,25 +14,23 @@ * a gnutls function (recv/send), is an alert, and will print * that alert. */ -void -check_alert (gnutls_session_t session, int ret) +void check_alert(gnutls_session_t session, int ret) { - int last_alert; + int last_alert; - if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED - || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) - { - last_alert = gnutls_alert_get (session); + if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED + || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) { + last_alert = gnutls_alert_get(session); - /* The check for renegotiation is only useful if we are - * a server, and we had requested a rehandshake. - */ - if (last_alert == GNUTLS_A_NO_RENEGOTIATION && - ret == GNUTLS_E_WARNING_ALERT_RECEIVED) - printf ("* Received NO_RENEGOTIATION alert. " - "Client Does not support renegotiation.\n"); - else - printf ("* Received alert '%d': %s.\n", last_alert, - gnutls_alert_get_name (last_alert)); - } + /* The check for renegotiation is only useful if we are + * a server, and we had requested a rehandshake. + */ + if (last_alert == GNUTLS_A_NO_RENEGOTIATION && + ret == GNUTLS_E_WARNING_ALERT_RECEIVED) + printf("* Received NO_RENEGOTIATION alert. " + "Client Does not support renegotiation.\n"); + else + printf("* Received alert '%d': %s.\n", last_alert, + gnutls_alert_get_name(last_alert)); + } } |