From 208eb7ae61109d1ea0650f4aaefe2efb149e3755 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 19 Jan 2005 11:05:57 +0000 Subject: [PATCH] * modules/proxy/proxy_http.c (ap_proxy_http_process_response): Handle aborted connections correctly: abort if c->aborted is set. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * modules/proxy/proxy_ftp.c (proxy_ftp_handler): Likewise. PR: 32443 Submitted by: Janne Hietamäki, Joe Orton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@125612 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/proxy/proxy_ftp.c | 3 ++- modules/proxy/proxy_http.c | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4ed67c86607..679cec8a93b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.3 [Remove entries to the current 2.0 section below, when backported] + *) mod_proxy: Handle client-aborted connections correctly. PR 32443. + [Janne Hietamäki, Joe Orton] + *) mod_cache: Remove unimplemented CacheForceCompletion directive. [Justin Erenkrantz] diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index aca55cc31db..5dc6db2c0cc 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -1821,7 +1821,8 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, } /* try send what we read */ - if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS) { + if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS + || c->aborted) { /* Ack! Phbtt! Die! User aborted! */ finish = TRUE; } diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 57cfd6367de..5552403313e 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -928,7 +928,8 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* flush to the client and switch to blocking mode */ e = apr_bucket_flush_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); - if (ap_pass_brigade(r->output_filters, bb)) { + if (ap_pass_brigade(r->output_filters, bb) + || c->aborted) { backend->close = 1; break; } @@ -972,7 +973,8 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, } /* try send what we read */ - if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS) { + if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS + || c->aborted) { /* Ack! Phbtt! Die! User aborted! */ backend->close = 1; /* this causes socket close below */ finish = TRUE; -- 2.47.2