From a771c28c817688fadf62745beae0cb4bfbb748fc Mon Sep 17 00:00:00 2001 From: robs Date: Tue, 17 Oct 2000 01:58:16 +0000 Subject: [PATCH] Call ap_reset_timeout() periodically. Don't use the wrapper if the User/Group is the same as the server --- CHANGES | 8 ++++++++ fcgi_pm.c | 4 ++-- mod_fastcgi.c | 27 ++++++++------------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index 03ac8e2..4e52fb9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ 2.2.9 + *) Don't invoke suexec when the user/group for the fastcgi application + is the same as the apache main server. This is consistent with + apache's suexec handling. + + *) Reset the apache drop dead timer upon successful read or writes + to/from the client. This eliminates timeouts that were occuring + during the large file transfers to/from slow clients. + *) Support generic wrappers such as cgiwrap by eliminating dependencies on Apache's SUEXEC, renaming the FastCgiSuexec directive FastCgiWrapper and eliminating any checks regarding the target diff --git a/fcgi_pm.c b/fcgi_pm.c index 3135b4c..38f630c 100644 --- a/fcgi_pm.c +++ b/fcgi_pm.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_pm.c,v 1.41 2000/09/19 16:26:51 robs Exp $ + * $Id: fcgi_pm.c,v 1.42 2000/10/17 01:58:16 robs Exp $ */ @@ -399,7 +399,7 @@ static pid_t spawn_fs_process(fcgi_server *fs, ServerProcess *process) * install its own handler. */ signal(SIGPIPE, SIG_IGN); - if (fcgi_wrapper) { + if (fcgi_wrapper && (fcgi_user_id != fs->uid || fcgi_group_id != fs->gid)) { char *shortName = strrchr(fs->fs_path, '/') + 1; /* Relinquish our root real uid powers */ diff --git a/mod_fastcgi.c b/mod_fastcgi.c index 0e9c78e..f399407 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.99 2000/09/19 16:26:52 robs Exp $ + * $Id: mod_fastcgi.c,v 1.100 2000/10/17 01:58:16 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -55,21 +55,6 @@ * * 2. Request timeouts. * - * The Apache Timeout directive allows per-server configuration of - * the timeout associated with a request. This is typically used to - * detect dead clients. The timer is reset for every successful - * read/write. The default value is 5min. Thats way too long to tie - * up a FastCGI server. For now this dropdead timer is used a little - * differently in FastCGI. All of the FastCGI server I/O AND the - * client I/O must complete within Timeout seconds. This isn't - * exactly what we want.. it should be revisited. See http_main.h. - * - * We need a way to configurably control the timeout associated with - * FastCGI server exchanges AND one for client exchanges. This could - * be done with the select() in doWork() (which should be rewritten - * anyway). This will allow us to free up the FastCGI as soon as - * possible. - * * Earlier versions of this module used ap_soft_timeout() rather than * ap_hard_timeout() and ate FastCGI server output until it completed. * This precluded the FastCGI server from having to implement a @@ -636,11 +621,13 @@ static int read_from_client_n_queue(fcgi_request *fr) if ((countRead = ap_get_client_block(fr->r, end, count)) < 0) return -1; - if (countRead == 0) + if (countRead == 0) { fr->expectingClientContent = 0; - else + } + else { fcgi_buf_add_update(fr->clientInputBuffer, countRead); - + ap_reset_timeout(fr->r); + } } return OK; } @@ -676,6 +663,7 @@ static int write_to_client(fcgi_request *fr) } #endif + ap_reset_timeout(fr->r); /* Don't bother with a wrapped buffer, limiting exposure to slow * clients. The BUFF routines don't allow a writev from above, @@ -699,6 +687,7 @@ static int write_to_client(fcgi_request *fr) return -1; } #endif + ap_reset_timeout(fr->r); } fcgi_buf_toss(fr->clientOutputBuffer, count); -- 2.11.4.GIT