From 1d48b0afe250a827ba32b3ecfdc8c08032651863 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 20 Jul 2009 21:14:37 +0000 Subject: More fixes related to bug #102 --- src/gnutls_io.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gnutls_io.c b/src/gnutls_io.c index a8fd242..e145466 100644 --- a/src/gnutls_io.c +++ b/src/gnutls_io.c @@ -379,9 +379,11 @@ tryagain: ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctxt->c->base_server, "GnuTLS: Handshake Failed. Hit Maximum Attempts"); #endif - gnutls_alert_send(ctxt->session, GNUTLS_AL_FATAL, + if (ctxt->session) { + gnutls_alert_send(ctxt->session, GNUTLS_AL_FATAL, gnutls_error_to_alert(ret, NULL)); - if (ctxt->session) gnutls_deinit(ctxt->session); + gnutls_deinit(ctxt->session); + } ctxt->session = NULL; return -1; } @@ -411,9 +413,11 @@ tryagain: gnutls_strerror(ret)); #endif ctxt->status = -1; - gnutls_alert_send(ctxt->session, GNUTLS_AL_FATAL, + if (ctxt->session) { + gnutls_alert_send(ctxt->session, GNUTLS_AL_FATAL, gnutls_error_to_alert(ret, NULL)); - if (ctxt->session) gnutls_deinit(ctxt->session); + gnutls_deinit(ctxt->session); + } ctxt->session = NULL; return ret; } @@ -559,8 +563,10 @@ apr_status_t mgs_filter_output(ap_filter_t * f, } apr_brigade_cleanup(ctxt->output_bb); - if (ctxt->session) gnutls_deinit(ctxt->session); - ctxt->session = NULL; + if (APR_BUCKET_IS_EOS(bucket) && ctxt->session) { + gnutls_deinit(ctxt->session); + ctxt->session = NULL; + } continue; } else if (APR_BUCKET_IS_FLUSH(bucket) || APR_BUCKET_IS_EOS(bucket)) { -- cgit e='id' value='771ca63efe669f8b0a3ffaeba1f3be7e3688b35f'/>
Commit message (Collapse)AuthorAge
* The GnuTLSCache variable now can be given the specificGravatar Nikos Mavrogiannopoulos 2010-09-23
| | | | | option "sdbm" instead of "dbm". "dbm" will use the default dbm type of libapr while sdbm will force sdbm to be used.
* bumped versionGravatar Nikos Mavrogiannopoulos 2010-09-23
|
* Corrected behavior in Keep-Alive connections (do notGravatar Nikos Mavrogiannopoulos 2010-09-22
| | | | terminate the connection prematurely)
* Released 0.5.8.Gravatar Nikos Mavrogiannopoulos 2010-08-18
|
* Safer usage of session variable to prevent segmentation faults on closure. ↵Gravatar Nikos Mavrogiannopoulos 2010-08-18
| | | | Should solve issue #106.
* Depend on libgnutls for the activation and expiration time checks.Gravatar Nikos Mavrogiannopoulos 2010-07-02
|
* Session tickets are enabled by default.Gravatar Nikos Mavrogiannopoulos 2010-07-02
|
* Added option to turn on/off session tickets.Gravatar Nikos Mavrogiannopoulos 2010-07-01
|
* Released 0.5.7.Gravatar Nikos Mavrogiannopoulos 2010-07-01
|
* Force SDBM.Gravatar Nikos Mavrogiannopoulos 2010-07-01
|
* More libgcrypt fixes.Gravatar Nikos Mavrogiannopoulos 2010-06-30
|
* Added missing var.Gravatar Nikos Mavrogiannopoulos 2010-06-30
|
* Use libgcrypt calls only if gnutls is older than 2.11.0Gravatar Nikos Mavrogiannopoulos 2010-06-30
|
* added more text on session ticketsGravatar Nikos Mavrogiannopoulos 2010-06-27
|
* Check the cache DB every 15 minutes instead of checking on every write.Gravatar Nikos Mavrogiannopoulos 2010-06-27
|
* open the database as readonly when fetching.Gravatar Nikos Mavrogiannopoulos 2010-06-27
|
* properly initialize variable.Gravatar Nikos Mavrogiannopoulos 2010-06-27
|
* Added support for session tickets.