From: Ryan Bloom Date: Tue, 18 Apr 2000 00:08:30 +0000 (+0000) Subject: Add logic to timeout CGI scripts properly. This requires that APR pipes X-Git-Tag: apache-doc-split-01~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07f387cc5a37eaa466b2b3d1a941db3896d575aa;p=thirdparty%2Fapache%2Fhttpd.git Add logic to timeout CGI scripts properly. This requires that APR pipes can be timed out. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84986 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index fd811d4d344..d5324266fb2 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ Apache 2.0 STATUS: -Last modified at [$Date: 2000/04/17 19:17:20 $] +Last modified at [$Date: 2000/04/18 00:08:29 $] Release: @@ -36,10 +36,6 @@ RELEASE SHOWSTOPPERS: be moved out of the MPMs and into some common file (http_core.c?). Dean says presumably you mean an os-specific file? - * Pipes to CGI scripts are not being timed out - Status: code has been added to APR to support timing out pipes. - This needs to be used in Apache now. - * Put back resource limit code * suEXEC doesn't work diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 57bc4fef688..6f14a7ab2cf 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -360,6 +360,7 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr return APR_EBADF; *script_in = ap_bcreate(p, B_RD); ap_bpush_iol(*script_in, iol); + ap_bsetopt(*script_in, BO_TIMEOUT, &r->server->timeout); /* Fill in BUFF structure for parents pipe to child's stdin */ ap_get_childin(&file, procnew); @@ -368,6 +369,7 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr return APR_EBADF; *script_out = ap_bcreate(p, B_WR); ap_bpush_iol(*script_out, iol); + ap_bsetopt(*script_out, BO_TIMEOUT, &r->server->timeout); /* Fill in BUFF structure for parents pipe to child's stderr */ ap_get_childerr(&file, procnew); @@ -376,6 +378,7 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr return APR_EBADF; *script_err = ap_bcreate(p, B_RD); ap_bpush_iol(*script_err, iol); + ap_bsetopt(*script_err, BO_TIMEOUT, &r->server->timeout); } } ap_unblock_alarms();