From 1a0a7cb50ceafef4474164cbd73ee33a7708e619 Mon Sep 17 00:00:00 2001 From: robs Date: Tue, 29 May 2001 15:22:12 +0000 Subject: [PATCH] Added support for the -flush argument to FastCgiConfig Eric Sit [esit@alum.mit.edu] --- CHANGES | 3 +++ docs/mod_fastcgi.html | 6 +++++- fcgi.h | 3 ++- fcgi_config.c | 6 +++++- fcgi_pm.c | 3 ++- mod_fastcgi.c | 3 ++- mod_fastcgi.h | 10 ++++++++-- 7 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 36acdce..a360b70 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ 2.2.11 + *) Added support for the -flush argument to FastCgiConfig. + Eric Sit [esit@alum.mit.edu] + *) Change the "which call to module_init() is this" check to a more reliable approach. Doru Petrescu [pdoru@kappa.ro] diff --git a/docs/mod_fastcgi.html b/docs/mod_fastcgi.html index b3bb3c4..1100046 100644 --- a/docs/mod_fastcgi.html +++ b/docs/mod_fastcgi.html @@ -1,6 +1,6 @@ - + Apache module mod_fastcgi @@ -338,6 +338,10 @@ mutually exclusive. be built-in to the application (e.g. every 100th request it checks to see if there's a newer version on disk and exits if so). There may be an outstanding problem (bug) when this option is used with -restart. +
-flush (none) +
Force a write to the client as data is received from the application. By + default, mod_fastcgi buffers data in order to free the application + as quickly as possible.
-gainValue n (0.5)
A floating point value between 0 and 1 used as an exponent in the computation of the exponentially decayed connection times load factor of the currently diff --git a/fcgi.h b/fcgi.h index 9194f8e..eb86b8c 100644 --- a/fcgi.h +++ b/fcgi.h @@ -1,5 +1,5 @@ /* - * $Id: fcgi.h,v 1.31 2001/05/03 21:57:35 robs Exp $ + * $Id: fcgi.h,v 1.32 2001/05/29 15:22:12 robs Exp $ */ #ifndef FCGI_H @@ -485,6 +485,7 @@ extern u_int dynamicInitStartDelay; extern u_int dynamicRestartDelay; extern array_header *dynamic_pass_headers; extern u_int dynamic_idle_timeout; +extern int dynamicFlush; extern module MODULE_VAR_EXPORT fastcgi_module; diff --git a/fcgi_config.c b/fcgi_config.c index 6becdbb..57af1c0 100644 --- a/fcgi_config.c +++ b/fcgi_config.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_config.c,v 1.28 2001/05/03 20:51:24 robs Exp $ + * $Id: fcgi_config.c,v 1.29 2001/05/29 15:22:12 robs Exp $ */ #include "fcgi.h" @@ -263,6 +263,7 @@ void fcgi_config_reset_globals(void* dummy) dynamicRestartDelay = FCGI_DEFAULT_RESTART_DELAY; dynamic_pass_headers = NULL; dynamic_idle_timeout = FCGI_DEFAULT_IDLE_TIMEOUT; + dynamicFlush = FCGI_FLUSH; #ifndef WIN32 /* Close any old pipe (HUP/USR1) */ @@ -901,6 +902,9 @@ const char *fcgi_config_set_config(cmd_parms *cmd, void *dummy, const char *arg) } else if (strcasecmp(option, "-autoUpdate") == 0) { dynamicAutoUpdate = 1; + } + else if (strcasecmp(option, "-flush") == 0) { + dynamicFlush = TRUE; } else { return ap_psprintf(tp, "%s: invalid option: %s", name, option); diff --git a/fcgi_pm.c b/fcgi_pm.c index 135101c..8d6acaa 100644 --- a/fcgi_pm.c +++ b/fcgi_pm.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_pm.c,v 1.55 2001/05/03 22:06:30 robs Exp $ + * $Id: fcgi_pm.c,v 1.56 2001/05/29 15:22:13 robs Exp $ */ @@ -825,6 +825,7 @@ static void dynamic_read_msgs(int read_ready) s->listenQueueDepth = dynamicListenQueueDepth; s->initStartDelay = dynamicInitStartDelay; s->envp = dynamicEnvp; + s->flush = dynamicFlush; #ifdef WIN32 s->mutex_env_string = ap_psprintf(sp, "_FCGI_MUTEX_=%ld", mutex); diff --git a/mod_fastcgi.c b/mod_fastcgi.c index 6be0d5e..0f198b3 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.115 2001/05/03 22:33:53 robs Exp $ + * $Id: mod_fastcgi.c,v 1.116 2001/05/29 15:22:13 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -131,6 +131,7 @@ char **dynamicEnvp = &fcgi_empty_env; u_int dynamicProcessSlack = FCGI_DEFAULT_PROCESS_SLACK; int dynamicAutoRestart = FCGI_DEFAULT_RESTART_DYNAMIC; int dynamicAutoUpdate = FCGI_DEFAULT_AUTOUPDATE; +int dynamicFlush = FCGI_FLUSH; u_int dynamicListenQueueDepth = FCGI_DEFAULT_LISTEN_Q; u_int dynamicInitStartDelay = DEFAULT_INIT_START_DELAY; u_int dynamicRestartDelay = FCGI_DEFAULT_RESTART_DELAY; diff --git a/mod_fastcgi.h b/mod_fastcgi.h index e3c172f..c034ca8 100644 --- a/mod_fastcgi.h +++ b/mod_fastcgi.h @@ -1,5 +1,5 @@ /* - * $Id: mod_fastcgi.h,v 1.34 2001/05/03 22:04:17 robs Exp $ + * $Id: mod_fastcgi.h,v 1.36 2001/05/29 15:22:13 robs Exp $ */ #ifndef MOD_FASTCGI_H @@ -86,6 +86,12 @@ * fcgi apps when the binary on the * disk is changed. */ +/* + * Should data recieved from the FastCGI server be immediately flushed to + * the client? Default: FALSE + */ +#define FCGI_FLUSH FALSE + #ifdef WIN32 #define DEFAULT_SOCK_DIR "\\\\.\\pipe\\FastCGI\\" #else @@ -102,7 +108,7 @@ #define FCGI_MAXPATH 512 #endif -/* REQ_COMPLETE is the longest: id, path, user, gid, qtime, start */ +/* FCGI_REQUEST_COMPLETE_JOB is the longest: id, path, user, gid, qtime, start */ #define FCGI_MSG_CRAP 1 + 2 + MAX_USER_NAME_LEN + 1 + MAX_GID_CHAR_LEN + (2 * 11) + 3 #if defined(PIPE_BUF) && PIPE_BUF < FCGI_MAXPATH + FCGI_MSG_CRAP -- 2.11.4.GIT