From 6383dfad3b9d4f8b97663ee91ef2f33545ba1833 Mon Sep 17 00:00:00 2001 From: Chuck Murcko Date: Sat, 30 Jun 2001 04:50:31 +0000 Subject: [PATCH] Fix abort code path for HTTP proxy. Similar to Victor's patch for FTP proxy. No, Julia, it really *is* a double negative. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89486 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/CHANGES | 21 +++++++++++++++++++-- modules/proxy/proxy_ftp.c | 4 ++-- modules/proxy/proxy_http.c | 9 +++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/modules/proxy/CHANGES b/modules/proxy/CHANGES index b6cd476e7f..ce33ed932f 100644 --- a/modules/proxy/CHANGES +++ b/modules/proxy/CHANGES @@ -1,7 +1,14 @@ -mod_proxy changes for httpd 2.0.18-dev +mod_proxy changes for httpd 2.0.20-dev + + *) Fix abort code path in proxy_http.c, similar to FTP fix. + [Chuck Murcko ] + + *) Fix FTP ABOR command execution path. + [Victor Orlikowski ] *) FTP return code variable cleanup; fixed problem in login + [Chuck Murcko ] *) Get PORT working again in the ftp proxy. [Victor Orlikowski ] @@ -20,6 +27,8 @@ mod_proxy changes for httpd 2.0.18-dev [Chuck Murcko ] [Victor Orlikowski ] +mod_proxy changes for httpd 2.0.19 + *) Reverse previous patch since the core reverted. [Chuck Murcko ] @@ -51,6 +60,8 @@ mod_proxy changes for httpd 2.0.18-dev *) Fix warnings about byte count type on Darwin (connect handler). [Chuck Murcko ] +mod_proxy changes for httpd 2.0.18 + *) IPV6 EPSV support for IPV6 in FTP proxy. [Graham Leggett ] @@ -77,6 +88,8 @@ mod_proxy changes for httpd 2.0.18-dev *) Converted send_dir() to ap_proxy_send_dir_filter() in proxy_ftp.c. [Graham Leggett ] +mod_proxy changes for httpd 2.0.17 + *) Major rework of ap_proxy_ftp_handler() to use filters (begone foul BUFF!!!). It compiles, but is untested, and the build environment needs to be fixed to include proxy_ftp.c. @@ -94,6 +107,8 @@ mod_proxy changes for httpd 2.0.18-dev would not trigger an IP address check with ProxyBlock. [Graham Leggett ] +mod_proxy changes for httpd 2.0.16 + *) Fixed ProxyBlock bugs with ap_proxy_http_handler() and ap_proxy_connect_handler(). [Graham Leggett ] @@ -110,6 +125,8 @@ mod_proxy changes for httpd 2.0.18-dev the directly following proxy keepalive request to fail. [Graham Leggett ] +mod_proxy changes for httpd 2.0.15 + *) Added support for downstream keepalives in mod_proxy. [Graham Leggett ] @@ -142,7 +159,7 @@ mod_proxy changes for httpd 2.0.18-dev - Some cosmetic fixes and commenting. [Graham Leggett ] -mod_proxy changes for 2.0.14 alpha +mod_proxy changes for httpd 2.0.14 *) removed ProxyNoCache and ProxyCacheForceCompletion config directives, since we no longer directly cache from this module diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index 9f63831826..134a3c034c 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -794,7 +794,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, * after the time of the response. * Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds ) */ - for (i=0 ; buffer[i] && !isdigit(buffer[i]); i++); + for (i = 0; buffer[i] && !isdigit(buffer[i]); i++); if (buffer[i]) { ap_table_add(r->headers_out, "Retry-After", apr_psprintf(p, "%lu", 60*atol(buffer+i))); } @@ -1264,7 +1264,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, /* set request; "path" holds last path component */ len = decodeenc(path); - /* TM - if len == 0 then it must be a directory (you can't RETR anything) */ + /* TM - if len == 0 then it must be a directory (you can't RETR nothing) */ if (len == 0) { parms = "d"; diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 107f2cd21b..bae4571931 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -788,8 +788,13 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf, ap_pass_brigade(r->output_filters, bb); break; } - ap_pass_brigade(r->output_filters, bb); - apr_brigade_cleanup(bb); + if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS) { + /* Ack! Phbtt! Die! User aborted! */ + apr_brigade_cleanup(bb); + close = 1; /* this causes socket close below */ + break; + } + apr_brigade_cleanup(bb); } ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server, "proxy: end body send"); -- 2.50.1