From 7ce01c9c9325468b6ed85ba64a9899d12cfe0fa0 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 22 Sep 2010 08:05:48 +0200 Subject: Corrected behavior in Keep-Alive connections (do not terminate the connection prematurely) --- src/gnutls_io.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src') 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