From 7ce01c9c9325468b6ed85ba64a9899d12cfe0fa0 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 22 Sep 2010 06:05:48 +0000 Subject: Corrected behavior in Keep-Alive connections (do not terminate the connection prematurely) --- diff --git a/NEWS b/NEWS index 7053a95..fe85119 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +** Version 0.5.9 (unreleased) +- Corrected behavior in Keep-Alive connections (do not + terminate the connection prematurely) + ** Version 0.5.8 (2010-08-18) - Session tickets are enabled by default. diff --git a/src/gnutls_io.c b/src/gnutls_io.c index ba03fce..6db2b28 100644 --- a/src/gnutls_io.c +++ b/src/gnutls_io.c @@ -555,15 +555,7 @@ apr_status_t mgs_filter_output(ap_filter_t * f, while (!APR_BRIGADE_EMPTY(bb)) { apr_bucket *bucket = APR_BRIGADE_FIRST(bb); - if (AP_BUCKET_IS_EOC(bucket) || APR_BUCKET_IS_EOS(bucket)) { - apr_bucket_brigade * tmpb; - - if (APR_BUCKET_IS_EOS(bucket)) { - tmpb = bb; - } else { - tmpb = ctxt->output_bb; - } - + if (AP_BUCKET_IS_EOC(bucket)) { if (ctxt->session != NULL) { do { ret = gnutls_bye( ctxt->session, GNUTLS_SHUT_WR); @@ -573,7 +565,7 @@ apr_status_t mgs_filter_output(ap_filter_t * f, apr_bucket_copy(bucket, &e); APR_BRIGADE_INSERT_TAIL(ctxt->output_bb, e); - if ((status = ap_pass_brigade(f->next, tmpb)) != APR_SUCCESS) { + if ((status = ap_pass_brigade(f->next, ctxt->output_bb)) != APR_SUCCESS) { apr_brigade_cleanup(ctxt->output_bb); return status; } @@ -584,7 +576,7 @@ apr_status_t mgs_filter_output(ap_filter_t * f, ctxt->session = NULL; } continue; - } else if (APR_BUCKET_IS_FLUSH(bucket)) { + } else if (APR_BUCKET_IS_FLUSH(bucket) || APR_BUCKET_IS_EOS(bucket)) { apr_bucket_copy(bucket, &e); APR_BRIGADE_INSERT_TAIL(ctxt->output_bb, e); -- cgit v0.9.2