You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2005/11/10 16:22:44 UTC
svn commit: r332309 [4/13] - in /httpd/httpd/branches/2.2.x: modules/aaa/
modules/arch/netware/ modules/arch/win32/ modules/cache/ modules/dav/fs/
modules/dav/lock/ modules/dav/main/ modules/debug/ modules/echo/
modules/experimental/ modules/filters/ m...
Modified: httpd/httpd/branches/2.2.x/modules/filters/mod_ext_filter.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/filters/mod_ext_filter.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/filters/mod_ext_filter.c (original)
+++ httpd/httpd/branches/2.2.x/modules/filters/mod_ext_filter.c Thu Nov 10 07:20:05 2005
@@ -76,8 +76,8 @@
static const server_rec *main_server;
static apr_status_t ef_output_filter(ap_filter_t *, apr_bucket_brigade *);
-static apr_status_t ef_input_filter(ap_filter_t *, apr_bucket_brigade *,
- ap_input_mode_t, apr_read_type_e,
+static apr_status_t ef_input_filter(ap_filter_t *, apr_bucket_brigade *,
+ ap_input_mode_t, apr_read_type_e,
apr_off_t);
#define DBGLVL_SHOWOPTIONS 1
@@ -143,7 +143,7 @@
dc->log_stderr = 0;
}
else {
- return apr_pstrcat(cmd->temp_pool,
+ return apr_pstrcat(cmd->temp_pool,
"Invalid ExtFilterOptions option: ",
arg,
NULL);
@@ -196,7 +196,7 @@
return "Invalid cmd= parameter";
}
filter->command = filter->args[0];
-
+
return NULL;
}
@@ -239,7 +239,7 @@
filter->preserves_content_length = 1;
}
else {
- return apr_psprintf(cmd->pool,
+ return apr_psprintf(cmd->pool,
"mangled argument `%s'",
token);
}
@@ -275,14 +275,14 @@
filter->enable_env = token;
continue;
}
-
+
if (!strncasecmp(args, "disableenv=", 11)) {
args += 11;
token = ap_getword_white(cmd->pool, &args);
filter->disable_env = token;
continue;
}
-
+
if (!strncasecmp(args, "intype=", 7)) {
args += 7;
filter->intype = ap_getword_white(cmd->pool, &args);
@@ -307,7 +307,7 @@
args);
}
- /* parsing is done... register the filter
+ /* parsing is done... register the filter
*/
if (filter->mode == OUTPUT_FILTER) {
/* XXX need a way to ensure uniqueness among all filters */
@@ -350,12 +350,12 @@
ap_hook_post_config(ef_init, NULL, NULL, APR_HOOK_MIDDLE);
}
-static apr_status_t set_resource_limits(request_rec *r,
+static apr_status_t set_resource_limits(request_rec *r,
apr_procattr_t *procattr)
{
#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \
defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
- core_dir_config *conf =
+ core_dir_config *conf =
(core_dir_config *)ap_get_module_config(r->per_dir_config,
&core_module);
apr_status_t rv;
@@ -438,12 +438,12 @@
rc = apr_procattr_child_errfn_set(ctx->procattr, child_errfn);
ap_assert(rc == APR_SUCCESS);
apr_pool_userdata_set(f->r, ERRFN_USERDATA_KEY, apr_pool_cleanup_null, ctx->p);
-
+
if (dc->debug >= DBGLVL_ERRORCHECK) {
rc = apr_procattr_error_check_set(ctx->procattr, 1);
ap_assert(rc == APR_SUCCESS);
}
-
+
/* add standard CGI variables as well as DOCUMENT_URI, DOCUMENT_PATH_INFO,
* and QUERY_STRING_UNESCAPED
*/
@@ -462,11 +462,11 @@
env = (const char * const *) ap_create_environment(ctx->p,
f->r->subprocess_env);
- rc = apr_proc_create(ctx->proc,
- ctx->filter->command,
- (const char * const *)ctx->filter->args,
+ rc = apr_proc_create(ctx->proc,
+ ctx->filter->command,
+ (const char * const *)ctx->filter->args,
env, /* environment */
- ctx->procattr,
+ ctx->procattr,
ctx->p);
if (rc != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, f->r,
@@ -483,7 +483,7 @@
* be open.
*/
- apr_pool_cleanup_register(ctx->p, ctx->proc->in,
+ apr_pool_cleanup_register(ctx->p, ctx->proc->in,
apr_pool_cleanup_null, /* other mechanism */
ef_close_file);
@@ -513,7 +513,7 @@
static const char *get_cfg_string(ef_dir_t *dc, ef_filter_t *filter, apr_pool_t *p)
{
- const char *debug_str = dc->debug == -1 ?
+ const char *debug_str = dc->debug == -1 ?
"DebugLevel=0" : apr_psprintf(p, "DebugLevel=%d", dc->debug);
const char *log_stderr_str = dc->log_stderr < 1 ?
"NoLogStderr" : "LogStderr";
@@ -523,7 +523,7 @@
"*/*" : filter->intype;
const char *outtype_str = !filter->outtype ?
"(unchanged)" : filter->outtype;
-
+
return apr_psprintf(p,
"ExtFilterOptions %s %s %s ExtFilterInType %s "
"ExtFilterOuttype %s",
@@ -583,7 +583,7 @@
/* wrong IMT for us; don't mess with the output */
ctx->noop = 1;
}
- }
+ }
else {
ctx->noop = 1;
}
@@ -608,7 +608,7 @@
ap_set_content_type(f->r, ctx->filter->outtype);
}
if (ctx->filter->preserves_content_length != 1) {
- /* nasty, but needed to avoid confusing the browser
+ /* nasty, but needed to avoid confusing the browser
*/
apr_table_unset(f->r->headers_out, "Content-Length");
}
@@ -627,7 +627,7 @@
return APR_SUCCESS;
}
-/* drain_available_output():
+/* drain_available_output():
*
* if any data is available from the filter, read it and append it
* to the the bucket brigade
@@ -663,12 +663,12 @@
return APR_SUCCESS;
}
/* we should never get here; if we do, a bogus error message would be
- * the least of our problems
+ * the least of our problems
*/
return APR_ANONYMOUS;
}
-static apr_status_t pass_data_to_filter(ap_filter_t *f, const char *data,
+static apr_status_t pass_data_to_filter(ap_filter_t *f, const char *data,
apr_size_t len, apr_bucket_brigade *bb)
{
ef_ctx_t *ctx = f->ctx;
@@ -676,7 +676,7 @@
apr_status_t rv;
apr_size_t bytes_written = 0;
apr_size_t tmplen;
-
+
do {
tmplen = len - bytes_written;
rv = apr_file_write(ctx->proc->in,
@@ -690,7 +690,7 @@
return rv;
}
if (APR_STATUS_IS_EAGAIN(rv)) {
- /* XXX handle blocking conditions here... if we block, we need
+ /* XXX handle blocking conditions here... if we block, we need
* to read data from the child process and pass it down to the
* next filter!
*/
@@ -699,24 +699,24 @@
#if APR_FILES_AS_SOCKETS
int num_events;
const apr_pollfd_t *pdesc;
-
+
rv = apr_pollset_poll(ctx->pollset, f->r->server->timeout,
&num_events, &pdesc);
if (rv || dc->debug >= DBGLVL_GORY) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG,
rv, f->r, "apr_pollset_poll()");
}
- if (rv != APR_SUCCESS && !APR_STATUS_IS_EINTR(rv)) {
+ if (rv != APR_SUCCESS && !APR_STATUS_IS_EINTR(rv)) {
/* some error such as APR_TIMEUP */
return rv;
}
#else /* APR_FILES_AS_SOCKETS */
/* Yuck... I'd really like to wait until I can read
- * or write, but instead I have to sleep and try again
+ * or write, but instead I have to sleep and try again
*/
apr_sleep(100000); /* 100 milliseconds */
if (dc->debug >= DBGLVL_GORY) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG,
0, f->r, "apr_sleep()");
}
#endif /* APR_FILES_AS_SOCKETS */
@@ -729,9 +729,9 @@
return rv;
}
-/* ef_unified_filter:
+/* ef_unified_filter:
*
- * runs the bucket brigade bb through the filter and puts the result into
+ * runs the bucket brigade bb through the filter and puts the result into
* bb, dropping the previous content of bb (the input)
*/
@@ -778,7 +778,7 @@
apr_brigade_cleanup(bb);
APR_BRIGADE_CONCAT(bb, bb_tmp);
apr_brigade_destroy(bb_tmp);
-
+
if (eos) {
/* close the child's stdin to signal that no more data is coming;
* that will cause the child to finish generating output
@@ -788,10 +788,10 @@
"apr_file_close(child input)");
return rv;
}
- /* since we've seen eos and closed the child's stdin, set the proper pipe
- * timeout; we don't care if we don't return from apr_file_read() for a while...
+ /* since we've seen eos and closed the child's stdin, set the proper pipe
+ * timeout; we don't care if we don't return from apr_file_read() for a while...
*/
- rv = apr_file_pipe_timeout_set(ctx->proc->out,
+ rv = apr_file_pipe_timeout_set(ctx->proc->out,
r->server->timeout);
if (rv) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
@@ -818,7 +818,7 @@
}
return APR_SUCCESS;
}
-
+
if (rv == APR_SUCCESS) {
b = apr_bucket_heap_create(buf, len, NULL, c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
@@ -855,7 +855,7 @@
}
rv = ef_unified_filter(f, bb);
- if (rv != APR_SUCCESS) {
+ if (rv != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"ef_unified_filter() failed");
}
@@ -867,7 +867,7 @@
return rv;
}
-static int ef_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
+static int ef_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
ap_input_mode_t mode, apr_read_type_e block,
apr_off_t readbytes)
{
Modified: httpd/httpd/branches/2.2.x/modules/filters/mod_filter.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/filters/mod_filter.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/filters/mod_filter.c (original)
+++ httpd/httpd/branches/2.2.x/modules/filters/mod_filter.c Thu Nov 10 07:20:05 2005
@@ -42,7 +42,7 @@
module AP_MODULE_DECLARE_DATA filter_module;
/**
- * @brief is a filter provider, as defined and implemented by mod_filter.
+ * @brief is a filter provider, as defined and implemented by mod_filter.
*
* The struct is a linked list, with dispatch criteria
* defined for each filter. The provider implementation itself is a
@@ -278,10 +278,10 @@
* The idea is that by putting this in mod_filter, we relieve
* filter implementations of the burden of fixing up HTTP headers
* for cases that are routinely affected by filters.
- *
+ *
* Default is ALWAYS to do nothing, so as not to tread on the
* toes of filters which want to do it themselves.
- *
+ *
*/
proto_flags = provider->frec->proto_flags;
@@ -650,7 +650,7 @@
str = apr_pstrdup(cmd->pool, condition);
ap_str_tolower(str);
}
-
+
if ( (provider->dispatch == RESPONSE_HEADERS)
&& !strcmp(str, "content-type")) {
provider->dispatch = CONTENT_TYPE;
Modified: httpd/httpd/branches/2.2.x/modules/filters/mod_include.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/filters/mod_include.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/filters/mod_include.c (original)
+++ httpd/httpd/branches/2.2.x/modules/filters/mod_include.c Thu Nov 10 07:20:05 2005
@@ -1218,7 +1218,7 @@
current = root = new;
continue;
}
-
+
new->left = current->right;
new->left->parent = new;
new->parent = current;
@@ -1554,7 +1554,7 @@
if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
to_send = rr->filename;
- if ((rv = apr_stat(finfo, to_send,
+ if ((rv = apr_stat(finfo, to_send,
APR_FINFO_GPROT | APR_FINFO_MIN, rr->pool)) != APR_SUCCESS
&& rv != APR_INCOMPLETE) {
error_fmt = "unable to get information about \"%s\" "
@@ -1574,7 +1574,7 @@
}
if (rr) ap_destroy_sub_req(rr);
-
+
return ret;
}
else if (!strcmp(tag, "virtual")) {
@@ -1862,12 +1862,12 @@
ctx->time_str = ap_ssi_parse_string(ctx, tag_val, NULL, 0,
SSI_EXPAND_DROP_NAME);
- apr_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date,
+ apr_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date,
ctx->time_str, 0));
- apr_table_setn(env, "DATE_GMT", ap_ht_time(r->pool, date,
+ apr_table_setn(env, "DATE_GMT", ap_ht_time(r->pool, date,
ctx->time_str, 1));
apr_table_setn(env, "LAST_MODIFIED",
- ap_ht_time(r->pool, r->finfo.mtime,
+ ap_ht_time(r->pool, r->finfo.mtime,
ctx->time_str, 0));
}
else if (!strcmp(tag, "sizefmt")) {
@@ -2215,7 +2215,7 @@
}
DEBUG_DUMP_COND(ctx, " else");
-
+
if (ctx->flags & SSI_FLAG_COND_TRUE) {
ctx->flags &= SSI_FLAG_CLEAR_PRINTING;
}
@@ -2286,7 +2286,7 @@
return APR_SUCCESS;
}
- /* we need to use the 'main' request pool to set notes as that is
+ /* we need to use the 'main' request pool to set notes as that is
* a notes lifetime
*/
while (sub) {
@@ -2415,15 +2415,15 @@
/* This is an implementation of the BNDM search algorithm.
*
- * Fast and Flexible String Matching by Combining Bit-parallelism and
- * Suffix Automata (2001)
+ * Fast and Flexible String Matching by Combining Bit-parallelism and
+ * Suffix Automata (2001)
* Gonzalo Navarro, Mathieu Raffinot
*
* http://www-igm.univ-mlv.fr/~raffinot/ftp/jea2001.ps.gz
*
* Initial code submitted by Sascha Schumann.
*/
-
+
/* Precompile the bndm_t data structure. */
static bndm_t *bndm_compile(apr_pool_t *pool, const char *n, apr_size_t nl)
{
@@ -2447,7 +2447,7 @@
*
* h - the string to look in
* hl - length of the string to look for
- * t - precompiled bndm structure against the pattern
+ * t - precompiled bndm structure against the pattern
*
* Returns the count of character that is the first match or hl if no
* match is found.
@@ -3573,7 +3573,7 @@
/* Always unset the Last-Modified field - see RFC2616 - 13.3.4.
* We don't know if we are going to be including a file or executing
- * a program which may change the Last-Modified header or make the
+ * a program which may change the Last-Modified header or make the
* content completely dynamic. Therefore, we can't support these
* headers.
* Exception: XBitHack full means we *should* set the Last-Modified field.
@@ -3606,17 +3606,17 @@
static int include_fixup(request_rec *r)
{
include_dir_config *conf;
-
+
conf = ap_get_module_config(r->per_dir_config, &include_module);
-
- if (r->handler && (strcmp(r->handler, "server-parsed") == 0))
+
+ if (r->handler && (strcmp(r->handler, "server-parsed") == 0))
{
if (!r->content_type || !*r->content_type) {
ap_set_content_type(r, "text/html");
}
r->handler = "default-handler";
}
- else
+ else
#if defined(OS2) || defined(WIN32) || defined(NETWARE)
/* These OS's don't support xbithack. This is being worked on. */
{
@@ -3674,7 +3674,7 @@
result->default_end_tag = DEFAULT_END_SEQUENCE;
result->default_start_tag = DEFAULT_START_SEQUENCE;
- return result;
+ return result;
}
static const char *set_xbithack(cmd_parms *cmd, void *mconfig, const char *arg)
@@ -3799,9 +3799,9 @@
static const command_rec includes_cmds[] =
{
- AP_INIT_TAKE1("XBitHack", set_xbithack, NULL, OR_OPTIONS,
+ AP_INIT_TAKE1("XBitHack", set_xbithack, NULL, OR_OPTIONS,
"Off, On, or Full"),
- AP_INIT_TAKE1("SSIErrorMsg", set_default_error_msg, NULL, OR_ALL,
+ AP_INIT_TAKE1("SSIErrorMsg", set_default_error_msg, NULL, OR_ALL,
"a string"),
AP_INIT_TAKE1("SSITimeFormat", set_default_time_fmt, NULL, OR_ALL,
"a strftime(3) formatted string"),
Modified: httpd/httpd/branches/2.2.x/modules/generators/mod_asis.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/generators/mod_asis.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/generators/mod_asis.c (original)
+++ httpd/httpd/branches/2.2.x/modules/generators/mod_asis.c Thu Nov 10 07:20:05 2005
@@ -47,7 +47,7 @@
return HTTP_NOT_FOUND;
}
- if ((rv = apr_file_open(&f, r->filename, APR_READ,
+ if ((rv = apr_file_open(&f, r->filename, APR_READ,
APR_OS_DEFAULT, r->pool)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"file permissions deny server access: %s", r->filename);
@@ -92,7 +92,7 @@
bb = apr_brigade_create(r->pool, c->bucket_alloc);
#if APR_HAS_LARGE_FILES
if (r->finfo.size - pos > AP_MAX_SENDFILE) {
- /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets,
+ /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets,
* no greater than MAX(apr_size_t), and more granular than that
* in case the brigade code/filters attempt to read it directly.
*/
Modified: httpd/httpd/branches/2.2.x/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/generators/mod_autoindex.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/branches/2.2.x/modules/generators/mod_autoindex.c Thu Nov 10 07:20:05 2005
@@ -1305,7 +1305,7 @@
return (NULL);
}
- if((autoindex_opts & SHOW_FORBIDDEN)
+ if((autoindex_opts & SHOW_FORBIDDEN)
&& (rr->status == HTTP_UNAUTHORIZED || rr->status == HTTP_FORBIDDEN)) {
show_forbidden = 1;
}
@@ -2070,7 +2070,7 @@
else if (qstring[2] == '1') {
autoindex_opts |= VERSION_SORT;
}
- strcpy(vval, ";V= ");
+ strcpy(vval, ";V= ");
vval[3] = qstring[2];
qstring += qstring[3] ? 4 : 3;
}
Modified: httpd/httpd/branches/2.2.x/modules/generators/mod_cgi.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/generators/mod_cgi.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/generators/mod_cgi.c (original)
+++ httpd/httpd/branches/2.2.x/modules/generators/mod_cgi.c Thu Nov 10 07:20:05 2005
@@ -16,14 +16,14 @@
/*
* http_script: keeps all script-related ramblings together.
- *
+ *
* Compliant to CGI/1.1 spec
- *
+ *
* Adapted by rst from original NCSA code by Rob McCool
*
* Apache adds some new env vars; REDIRECT_URL and REDIRECT_QUERY_STRING for
* custom error responses, and DOCUMENT_ROOT because we found it useful.
- * It also adds SERVER_ADMIN - useful for scripts to know who to mail when
+ * It also adds SERVER_ADMIN - useful for scripts to know who to mail when
* they fail.
*/
@@ -165,7 +165,7 @@
char time_str[APR_CTIME_LEN];
int log_flags = rv ? APLOG_ERR : APLOG_ERR;
- ap_log_rerror(APLOG_MARK, log_flags, rv, r,
+ ap_log_rerror(APLOG_MARK, log_flags, rv, r,
"%s: %s", error, r->filename);
/* XXX Very expensive mainline case! Open, then getfileinfo! */
@@ -192,7 +192,7 @@
return ret;
}
-/* Soak up stderr from a script and redirect it to the error log.
+/* Soak up stderr from a script and redirect it to the error log.
*/
static apr_status_t log_script_err(request_rec *r, apr_file_t *script_err)
{
@@ -206,15 +206,15 @@
if (newline) {
*newline = '\0';
}
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "%s", argsbuffer);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "%s", argsbuffer);
}
return rv;
}
static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
- char *dbuf, const char *sbuf, apr_bucket_brigade *bb,
+ char *dbuf, const char *sbuf, apr_bucket_brigade *bb,
apr_file_t *script_err)
{
const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
@@ -372,7 +372,7 @@
static apr_status_t run_cgi_child(apr_file_t **script_out,
apr_file_t **script_in,
- apr_file_t **script_err,
+ apr_file_t **script_err,
const char *command,
const char * const argv[],
request_rec *r,
@@ -423,7 +423,7 @@
e_info->in_pipe,
e_info->out_pipe,
e_info->err_pipe)) != APR_SUCCESS) ||
- ((rc = apr_procattr_dir_set(procattr,
+ ((rc = apr_procattr_dir_set(procattr,
ap_make_dirstr_parent(r->pool,
r->filename))) != APR_SUCCESS) ||
#ifdef RLIMIT_CPU
@@ -454,7 +454,7 @@
procnew = apr_pcalloc(p, sizeof(*procnew));
rc = ap_os_create_privileged_process(r, procnew, command, argv, env,
procattr, p);
-
+
if (rc != APR_SUCCESS) {
/* Bad things happened. Everyone should have cleaned up. */
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rc, r,
@@ -499,7 +499,7 @@
if (e_info->process_cgi) {
*cmd = r->filename;
- /* Do not process r->args if they contain an '=' assignment
+ /* Do not process r->args if they contain an '=' assignment
*/
if (r->args && r->args[0] && !ap_strchr_c(r->args, '=')) {
args = r->args;
@@ -517,9 +517,9 @@
}
}
}
- /* Everything is - 1 to account for the first parameter
+ /* Everything is - 1 to account for the first parameter
* which is the program name.
- */
+ */
if (numwords > APACHE_ARG_MAX - 1) {
numwords = APACHE_ARG_MAX - 1; /* Truncate args to prevent overrun */
}
@@ -577,7 +577,7 @@
apr_status_t rv;
apr_pollfd_t fd;
struct cgi_bucket_data *data = apr_palloc(r->pool, sizeof *data);
-
+
APR_BUCKET_INIT(b);
b->free = apr_bucket_free;
b->list = list;
@@ -596,12 +596,12 @@
fd.client_data = (void *)1;
rv = apr_pollset_add(data->pollset, &fd);
AP_DEBUG_ASSERT(rv == APR_SUCCESS);
-
+
fd.desc.f = err; /* script's stderr */
fd.client_data = (void *)2;
rv = apr_pollset_add(data->pollset, &fd);
AP_DEBUG_ASSERT(rv == APR_SUCCESS);
-
+
data->r = r;
b->data = data;
return b;
@@ -696,7 +696,7 @@
"poll failed waiting for CGI child");
return rv;
}
-
+
for (; num; num--, results++) {
if (results[0].client_data == (void *)1) {
/* stdout */
@@ -807,7 +807,7 @@
/* build the command line */
if ((rv = cgi_build_command(&command, &argv, r, p, &e_info)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "don't know how to spawn child process: %s",
+ "don't know how to spawn child process: %s",
r->filename);
return HTTP_INTERNAL_SERVER_ERROR;
}
@@ -835,7 +835,7 @@
rv = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES,
APR_BLOCK_READ, HUGE_STRING_LEN);
-
+
if (rv != APR_SUCCESS) {
return rv;
}
@@ -860,11 +860,11 @@
/* If the child stopped, we still must read to EOS. */
if (child_stopped_reading) {
continue;
- }
+ }
/* read */
apr_bucket_read(bucket, &data, &len, APR_BLOCK_READ);
-
+
if (conf->logname && dbpos < conf->bufbytes) {
int cursize;
@@ -906,7 +906,7 @@
#if APR_FILES_AS_SOCKETS
apr_file_pipe_timeout_set(script_in, 0);
apr_file_pipe_timeout_set(script_err, 0);
-
+
b = cgi_bucket_create(r, script_in, script_err, c->bucket_alloc);
#else
b = apr_bucket_pipe_create(script_in, c->bucket_alloc);
@@ -956,7 +956,7 @@
r->method_number = M_GET;
/* We already read the message body (if any), so don't allow
- * the redirected request to think it has one. We can ignore
+ * the redirected request to think it has one. We can ignore
* Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR.
*/
apr_table_unset(r->headers_in, "Content-Length");
@@ -975,7 +975,7 @@
}
else /* nph */ {
struct ap_filter_t *cur;
-
+
/* get rid of all filters up through protocol... since we
* haven't parsed off the headers, there is no way they can
* work
@@ -998,7 +998,7 @@
apr_file_pipe_timeout_set(script_err, r->server->timeout);
log_script_err(r, script_err);
}
-
+
apr_file_close(script_err);
return OK; /* NOT r->status, even if it has changed. */
@@ -1090,7 +1090,7 @@
if ((rv = cgi_build_command(&command, &argv, r, r->pool,
&e_info)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "don't know how to spawn cmd child process: %s",
+ "don't know how to spawn cmd child process: %s",
r->filename);
return rv;
}
Modified: httpd/httpd/branches/2.2.x/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/generators/mod_cgid.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/branches/2.2.x/modules/generators/mod_cgid.c Thu Nov 10 07:20:05 2005
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-/*
- * http_script: keeps all script-related ramblings together.
- *
- * Compliant to cgi/1.1 spec
- *
- * Adapted by rst from original NCSA code by Rob McCool
- *
- * Apache adds some new env vars; REDIRECT_URL and REDIRECT_QUERY_STRING for
- * custom error responses, and DOCUMENT_ROOT because we found it useful.
- * It also adds SERVER_ADMIN - useful for scripts to know who to mail when
- * they fail.
- */
+/*
+ * http_script: keeps all script-related ramblings together.
+ *
+ * Compliant to cgi/1.1 spec
+ *
+ * Adapted by rst from original NCSA code by Rob McCool
+ *
+ * Apache adds some new env vars; REDIRECT_URL and REDIRECT_QUERY_STRING for
+ * custom error responses, and DOCUMENT_ROOT because we found it useful.
+ * It also adds SERVER_ADMIN - useful for scripts to know who to mail when
+ * they fail.
+ */
#include "apr_lib.h"
#include "apr_strings.h"
@@ -49,17 +49,17 @@
#include <sys/types.h>
#endif
-#define CORE_PRIVATE
+#define CORE_PRIVATE
#include "util_filter.h"
-#include "httpd.h"
-#include "http_config.h"
-#include "http_request.h"
-#include "http_core.h"
-#include "http_protocol.h"
-#include "http_main.h"
-#include "http_log.h"
-#include "util_script.h"
+#include "httpd.h"
+#include "http_config.h"
+#include "http_request.h"
+#include "http_core.h"
+#include "http_protocol.h"
+#include "http_main.h"
+#include "http_log.h"
+#include "util_script.h"
#include "ap_mpm.h"
#include "unixd.h"
#include "mod_suexec.h"
@@ -73,17 +73,17 @@
#include <sys/un.h> /* for sockaddr_un */
-module AP_MODULE_DECLARE_DATA cgid_module;
+module AP_MODULE_DECLARE_DATA cgid_module;
static int cgid_start(apr_pool_t *p, server_rec *main_server, apr_proc_t *procnew);
-static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server);
+static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server);
static int handle_exec(include_ctx_t *ctx, ap_filter_t *f, apr_bucket_brigade *bb);
static APR_OPTIONAL_FN_TYPE(ap_register_include_handler) *cgid_pfn_reg_with_ssi;
static APR_OPTIONAL_FN_TYPE(ap_ssi_get_tag_and_value) *cgid_pfn_gtv;
static APR_OPTIONAL_FN_TYPE(ap_ssi_parse_string) *cgid_pfn_ps;
-static apr_pool_t *pcgi = NULL;
+static apr_pool_t *pcgi = NULL;
static int total_modules = 0;
static pid_t daemon_pid;
static int daemon_should_exit = 0;
@@ -101,26 +101,26 @@
*/
static ap_unix_identity_t *cgid_suexec_id_doer(const request_rec *r)
{
- return (ap_unix_identity_t *)
+ return (ap_unix_identity_t *)
ap_get_module_config(r->request_config, &cgid_module);
}
/* KLUDGE --- for back-combatibility, we don't have to check ExecCGI
- * in ScriptAliased directories, which means we need to know if this
- * request came through ScriptAlias or not... so the Alias module
- * leaves a note for us.
- */
-
-static int is_scriptaliased(request_rec *r)
-{
- const char *t = apr_table_get(r->notes, "alias-forced-type");
- return t && (!strcasecmp(t, "cgi-script"));
-}
+ * in ScriptAliased directories, which means we need to know if this
+ * request came through ScriptAlias or not... so the Alias module
+ * leaves a note for us.
+ */
+
+static int is_scriptaliased(request_rec *r)
+{
+ const char *t = apr_table_get(r->notes, "alias-forced-type");
+ return t && (!strcasecmp(t, "cgi-script"));
+}
-/* Configuration stuff */
+/* Configuration stuff */
-#define DEFAULT_LOGBYTES 10385760
-#define DEFAULT_BUFBYTES 1024
+#define DEFAULT_LOGBYTES 10385760
+#define DEFAULT_BUFBYTES 1024
#define DEFAULT_SOCKET DEFAULT_REL_RUNTIMEDIR "/cgisock"
#define CGI_REQ 1
@@ -153,11 +153,11 @@
#define DEFAULT_CONNECT_ATTEMPTS 15
#endif
-typedef struct {
- const char *logname;
- long logbytes;
- int bufbytes;
-} cgid_server_conf;
+typedef struct {
+ const char *logname;
+ long logbytes;
+ int bufbytes;
+} cgid_server_conf;
typedef struct {
int req_type; /* request type (CGI_REQ, SSI_REQ, etc.) */
@@ -199,7 +199,7 @@
}
else {
/* count the number of keywords */
-
+
for (x = 0, numwords = 1; args[x]; x++) {
if (args[x] == '+') {
++numwords;
@@ -331,16 +331,16 @@
return APR_SUCCESS;
}
-static apr_status_t get_req(int fd, request_rec *r, char **argv0, char ***env,
+static apr_status_t get_req(int fd, request_rec *r, char **argv0, char ***env,
cgid_req_t *req)
-{
- int i;
- char **environ;
- core_request_config *temp_core;
+{
+ int i;
+ char **environ;
+ core_request_config *temp_core;
void **rconf;
apr_status_t stat;
- r->server = apr_pcalloc(r->pool, sizeof(server_rec));
+ r->server = apr_pcalloc(r->pool, sizeof(server_rec));
/* read the request header */
stat = sock_read(fd, req, sizeof(*req));
@@ -356,11 +356,11 @@
/* handle module indexes and such */
rconf = (void **) apr_pcalloc(r->pool, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT));
- temp_core = (core_request_config *)apr_palloc(r->pool, sizeof(core_module));
+ temp_core = (core_request_config *)apr_palloc(r->pool, sizeof(core_module));
rconf[req->core_module_index] = (void *)temp_core;
- r->request_config = (ap_conf_vector_t *)rconf;
+ r->request_config = (ap_conf_vector_t *)rconf;
ap_set_module_config(r->request_config, &cgid_module, (void *)&req->ugid);
-
+
/* Read the filename, argv0, uri, and args */
r->filename = apr_pcalloc(r->pool, req->filename_len + 1);
*argv0 = apr_pcalloc(r->pool, req->argv0_len + 1);
@@ -394,46 +394,46 @@
*env = environ;
#if 0
-#ifdef RLIMIT_CPU
- sock_read(fd, &j, sizeof(int));
- if (j) {
- temp_core->limit_cpu = (struct rlimit *)apr_palloc (sizeof(struct rlimit));
- sock_read(fd, temp_core->limit_cpu, sizeof(struct rlimit));
- }
- else {
- temp_core->limit_cpu = NULL;
- }
-#endif
-
-#if defined (RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
- sock_read(fd, &j, sizeof(int));
- if (j) {
- temp_core->limit_mem = (struct rlimit *)apr_palloc(r->pool, sizeof(struct rlimit));
- sock_read(fd, temp_core->limit_mem, sizeof(struct rlimit));
- }
- else {
- temp_core->limit_mem = NULL;
- }
-#endif
-
-#ifdef RLIMIT_NPROC
- sock_read(fd, &j, sizeof(int));
- if (j) {
- temp_core->limit_nproc = (struct rlimit *)apr_palloc(r->pool, sizeof(struct rlimit));
- sock_read(fd, temp_core->limit_nproc, sizeof(struct rlimit));
- }
- else {
- temp_core->limit_nproc = NULL;
- }
-#endif
+#ifdef RLIMIT_CPU
+ sock_read(fd, &j, sizeof(int));
+ if (j) {
+ temp_core->limit_cpu = (struct rlimit *)apr_palloc (sizeof(struct rlimit));
+ sock_read(fd, temp_core->limit_cpu, sizeof(struct rlimit));
+ }
+ else {
+ temp_core->limit_cpu = NULL;
+ }
+#endif
+
+#if defined (RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
+ sock_read(fd, &j, sizeof(int));
+ if (j) {
+ temp_core->limit_mem = (struct rlimit *)apr_palloc(r->pool, sizeof(struct rlimit));
+ sock_read(fd, temp_core->limit_mem, sizeof(struct rlimit));
+ }
+ else {
+ temp_core->limit_mem = NULL;
+ }
+#endif
+
+#ifdef RLIMIT_NPROC
+ sock_read(fd, &j, sizeof(int));
+ if (j) {
+ temp_core->limit_nproc = (struct rlimit *)apr_palloc(r->pool, sizeof(struct rlimit));
+ sock_read(fd, temp_core->limit_nproc, sizeof(struct rlimit));
+ }
+ else {
+ temp_core->limit_nproc = NULL;
+ }
+#endif
#endif
return APR_SUCCESS;
-}
+}
-static apr_status_t send_req(int fd, request_rec *r, char *argv0, char **env,
- int req_type)
-{
+static apr_status_t send_req(int fd, request_rec *r, char *argv0, char **env,
+ int req_type)
+{
int i;
cgid_req_t req = {0};
apr_status_t stat;
@@ -444,13 +444,13 @@
} else {
memcpy(&req.ugid, ugid, sizeof(ap_unix_identity_t));
}
-
+
req.req_type = req_type;
req.ppid = parent_pid;
req.conn_id = r->connection->id;
req.core_module_index = core_module.module_index;
for (req.env_count = 0; env[req.env_count]; req.env_count++) {
- continue;
+ continue;
}
req.filename_len = strlen(r->filename);
req.argv0_len = strlen(argv0);
@@ -482,51 +482,51 @@
if ((stat = sock_write(fd, &curlen, sizeof(curlen))) != APR_SUCCESS) {
return stat;
}
-
+
if ((stat = sock_write(fd, env[i], curlen)) != APR_SUCCESS) {
return stat;
}
}
#if 0
-#ifdef RLIMIT_CPU
- if (conf->limit_cpu) {
- len = 1;
- stat = sock_write(fd, &len, sizeof(int));
- stat = sock_write(fd, conf->limit_cpu, sizeof(struct rlimit));
- }
- else {
- len = 0;
- stat = sock_write(fd, &len, sizeof(int));
- }
-#endif
-
-#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
- if (conf->limit_mem) {
- len = 1;
- stat = sock_write(fd, &len, sizeof(int));
- stat = sock_write(fd, conf->limit_mem, sizeof(struct rlimit));
- }
- else {
- len = 0;
- stat = sock_write(fd, &len, sizeof(int));
- }
-#endif
-
-#ifdef RLIMIT_NPROC
- if (conf->limit_nproc) {
- len = 1;
- stat = sock_write(fd, &len, sizeof(int));
- stat = sock_write(fd, conf->limit_nproc, sizeof(struct rlimit));
- }
- else {
- len = 0;
- stat = sock_write(fd, &len, sizeof(int));
- }
+#ifdef RLIMIT_CPU
+ if (conf->limit_cpu) {
+ len = 1;
+ stat = sock_write(fd, &len, sizeof(int));
+ stat = sock_write(fd, conf->limit_cpu, sizeof(struct rlimit));
+ }
+ else {
+ len = 0;
+ stat = sock_write(fd, &len, sizeof(int));
+ }
+#endif
+
+#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS)
+ if (conf->limit_mem) {
+ len = 1;
+ stat = sock_write(fd, &len, sizeof(int));
+ stat = sock_write(fd, conf->limit_mem, sizeof(struct rlimit));
+ }
+ else {
+ len = 0;
+ stat = sock_write(fd, &len, sizeof(int));
+ }
+#endif
+
+#ifdef RLIMIT_NPROC
+ if (conf->limit_nproc) {
+ len = 1;
+ stat = sock_write(fd, &len, sizeof(int));
+ stat = sock_write(fd, conf->limit_nproc, sizeof(struct rlimit));
+ }
+ else {
+ len = 0;
+ stat = sock_write(fd, &len, sizeof(int));
+ }
#endif
#endif
return APR_SUCCESS;
-}
+}
static void daemon_signal_handler(int sig)
{
@@ -551,8 +551,8 @@
ap_log_error(APLOG_MARK, APLOG_ERR, err, r->server, "%s", description);
}
-static int cgid_server(void *data)
-{
+static int cgid_server(void *data)
+{
struct sockaddr_un unix_addr;
int sd, sd2, rc;
mode_t omask;
@@ -561,9 +561,9 @@
server_rec *main_server = data;
apr_hash_t *script_hash = apr_hash_make(pcgi);
- apr_pool_create(&ptrans, pcgi);
+ apr_pool_create(&ptrans, pcgi);
- apr_signal(SIGCHLD, SIG_IGN);
+ apr_signal(SIGCHLD, SIG_IGN);
apr_signal(SIGHUP, daemon_signal_handler);
/* Close our copy of the listening sockets */
@@ -575,10 +575,10 @@
apr_hook_sort_all();
if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
- ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
+ ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
"Couldn't create unix domain socket");
return errno;
- }
+ }
memset(&unix_addr, 0, sizeof(unix_addr));
unix_addr.sun_family = AF_UNIX;
@@ -588,34 +588,34 @@
rc = bind(sd, (struct sockaddr *)&unix_addr, sizeof(unix_addr));
umask(omask); /* can't fail, so can't clobber errno */
if (rc < 0) {
- ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
+ ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
"Couldn't bind unix domain socket %s",
- sockname);
+ sockname);
return errno;
- }
+ }
if (listen(sd, DEFAULT_CGID_LISTENBACKLOG) < 0) {
- ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
- "Couldn't listen on unix domain socket");
+ ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
+ "Couldn't listen on unix domain socket");
return errno;
- }
+ }
if (!geteuid()) {
if (chown(sockname, unixd_config.user_id, -1) < 0) {
- ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
+ ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
"Couldn't change owner of unix domain socket %s",
- sockname);
+ sockname);
return errno;
}
}
-
+
unixd_setup_child(); /* if running as root, switch to configured user/group */
while (!daemon_should_exit) {
int errfileno = STDERR_FILENO;
- char *argv0;
- char **env;
- const char * const *argv;
+ char *argv0;
+ char **env;
+ const char * const *argv;
apr_int32_t in_pipe;
apr_int32_t out_pipe;
apr_int32_t err_pipe;
@@ -639,17 +639,17 @@
}
#endif
if (errno != EINTR) {
- ap_log_error(APLOG_MARK, APLOG_ERR, errno,
+ ap_log_error(APLOG_MARK, APLOG_ERR, errno,
(server_rec *)data,
"Error accepting on cgid socket");
}
continue;
}
-
- r = apr_pcalloc(ptrans, sizeof(request_rec));
+
+ r = apr_pcalloc(ptrans, sizeof(request_rec));
procnew = apr_pcalloc(ptrans, sizeof(*procnew));
- r->pool = ptrans;
- stat = get_req(sd2, r, &argv0, &env, &cgid_req);
+ r->pool = ptrans;
+ stat = get_req(sd2, r, &argv0, &env, &cgid_req);
if (stat != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, stat,
main_server,
@@ -696,12 +696,12 @@
}
if (((rc = apr_procattr_create(&procattr, ptrans)) != APR_SUCCESS) ||
- ((cgid_req.req_type == CGI_REQ) &&
+ ((cgid_req.req_type == CGI_REQ) &&
(((rc = apr_procattr_io_set(procattr,
in_pipe,
out_pipe,
err_pipe)) != APR_SUCCESS) ||
- /* XXX apr_procattr_child_*_set() is creating an unnecessary
+ /* XXX apr_procattr_child_*_set() is creating an unnecessary
* pipe between this process and the child being created...
* It is cleaned up with the temporary pool for this request.
*/
@@ -734,25 +734,25 @@
close(sd2);
if (memcmp(&empty_ugid, &cgid_req.ugid, sizeof(empty_ugid))) {
- /* We have a valid identity, and can be sure that
- * cgid_suexec_id_doer will return a valid ugid
+ /* We have a valid identity, and can be sure that
+ * cgid_suexec_id_doer will return a valid ugid
*/
rc = ap_os_create_privileged_process(r, procnew, argv0, argv,
(const char * const *)env,
procattr, ptrans);
} else {
- rc = apr_proc_create(procnew, argv0, argv,
- (const char * const *)env,
+ rc = apr_proc_create(procnew, argv0, argv,
+ (const char * const *)env,
procattr, ptrans);
}
-
+
if (rc != APR_SUCCESS) {
/* Bad things happened. Everyone should have cleaned up.
* ap_log_rerror() won't work because the header table used by
* ap_log_rerror() hasn't been replicated in the phony r
*/
ap_log_error(APLOG_MARK, APLOG_ERR, rc, r->server,
- "couldn't create child process: %d: %s", rc,
+ "couldn't create child process: %d: %s", rc,
apr_filepath_name_get(r->filename));
}
else {
@@ -779,9 +779,9 @@
(void *)((long)procnew->pid));
}
}
- }
- return -1;
-}
+ }
+ return -1;
+}
static int cgid_start(apr_pool_t *p, server_rec *main_server,
apr_proc_t *procnew)
@@ -816,9 +816,9 @@
return OK;
}
-static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
- server_rec *main_server)
-{
+static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
+ server_rec *main_server)
+{
apr_proc_t *procnew = NULL;
int first_time = 0;
const char *userdata_key = "cgid_init";
@@ -865,31 +865,31 @@
}
}
return ret;
-}
+}
+
+static void *create_cgid_config(apr_pool_t *p, server_rec *s)
+{
+ cgid_server_conf *c =
+ (cgid_server_conf *) apr_pcalloc(p, sizeof(cgid_server_conf));
+
+ c->logname = NULL;
+ c->logbytes = DEFAULT_LOGBYTES;
+ c->bufbytes = DEFAULT_BUFBYTES;
+ return c;
+}
+
+static void *merge_cgid_config(apr_pool_t *p, void *basev, void *overridesv)
+{
+ cgid_server_conf *base = (cgid_server_conf *) basev, *overrides = (cgid_server_conf *) overridesv;
+
+ return overrides->logname ? overrides : base;
+}
-static void *create_cgid_config(apr_pool_t *p, server_rec *s)
-{
- cgid_server_conf *c =
- (cgid_server_conf *) apr_pcalloc(p, sizeof(cgid_server_conf));
-
- c->logname = NULL;
- c->logbytes = DEFAULT_LOGBYTES;
- c->bufbytes = DEFAULT_BUFBYTES;
- return c;
-}
-
-static void *merge_cgid_config(apr_pool_t *p, void *basev, void *overridesv)
-{
- cgid_server_conf *base = (cgid_server_conf *) basev, *overrides = (cgid_server_conf *) overridesv;
-
- return overrides->logname ? overrides : base;
-}
-
-static const char *set_scriptlog(cmd_parms *cmd, void *dummy, const char *arg)
-{
- server_rec *s = cmd->server;
+static const char *set_scriptlog(cmd_parms *cmd, void *dummy, const char *arg)
+{
+ server_rec *s = cmd->server;
cgid_server_conf *conf = ap_get_module_config(s->module_config,
- &cgid_module);
+ &cgid_module);
conf->logname = ap_server_root_relative(cmd->pool, arg);
@@ -897,31 +897,31 @@
return apr_pstrcat(cmd->pool, "Invalid ScriptLog path ",
arg, NULL);
}
- return NULL;
-}
+ return NULL;
+}
-static const char *set_scriptlog_length(cmd_parms *cmd, void *dummy, const char *arg)
-{
- server_rec *s = cmd->server;
+static const char *set_scriptlog_length(cmd_parms *cmd, void *dummy, const char *arg)
+{
+ server_rec *s = cmd->server;
cgid_server_conf *conf = ap_get_module_config(s->module_config,
- &cgid_module);
+ &cgid_module);
+
+ conf->logbytes = atol(arg);
+ return NULL;
+}
- conf->logbytes = atol(arg);
- return NULL;
-}
-
-static const char *set_scriptlog_buffer(cmd_parms *cmd, void *dummy, const char *arg)
-{
- server_rec *s = cmd->server;
+static const char *set_scriptlog_buffer(cmd_parms *cmd, void *dummy, const char *arg)
+{
+ server_rec *s = cmd->server;
cgid_server_conf *conf = ap_get_module_config(s->module_config,
- &cgid_module);
+ &cgid_module);
- conf->bufbytes = atoi(arg);
- return NULL;
-}
+ conf->bufbytes = atoi(arg);
+ return NULL;
+}
-static const char *set_script_socket(cmd_parms *cmd, void *dummy, const char *arg)
-{
+static const char *set_script_socket(cmd_parms *cmd, void *dummy, const char *arg)
+{
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err != NULL) {
return err;
@@ -929,126 +929,126 @@
/* Make sure the pid is appended to the sockname */
sockname = ap_append_pid(cmd->pool, arg, ".");
- sockname = ap_server_root_relative(cmd->pool, sockname);
+ sockname = ap_server_root_relative(cmd->pool, sockname);
if (!sockname) {
return apr_pstrcat(cmd->pool, "Invalid ScriptSock path",
arg, NULL);
}
- return NULL;
-}
+ return NULL;
+}
-static const command_rec cgid_cmds[] =
-{
+static const command_rec cgid_cmds[] =
+{
AP_INIT_TAKE1("ScriptLog", set_scriptlog, NULL, RSRC_CONF,
- "the name of a log for script debugging info"),
+ "the name of a log for script debugging info"),
AP_INIT_TAKE1("ScriptLogLength", set_scriptlog_length, NULL, RSRC_CONF,
- "the maximum length (in bytes) of the script debug log"),
+ "the maximum length (in bytes) of the script debug log"),
AP_INIT_TAKE1("ScriptLogBuffer", set_scriptlog_buffer, NULL, RSRC_CONF,
- "the maximum size (in bytes) to record of a POST request"),
+ "the maximum size (in bytes) to record of a POST request"),
AP_INIT_TAKE1("ScriptSock", set_script_socket, NULL, RSRC_CONF,
"the name of the socket to use for communication with "
- "the cgi daemon."),
- {NULL}
-};
-
-static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret,
- apr_status_t rv, char *error)
-{
- apr_file_t *f = NULL;
- struct stat finfo;
+ "the cgi daemon."),
+ {NULL}
+};
+
+static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret,
+ apr_status_t rv, char *error)
+{
+ apr_file_t *f = NULL;
+ struct stat finfo;
char time_str[APR_CTIME_LEN];
int log_flags = rv ? APLOG_ERR : APLOG_ERR;
- ap_log_rerror(APLOG_MARK, log_flags, rv, r,
- "%s: %s", error, r->filename);
+ ap_log_rerror(APLOG_MARK, log_flags, rv, r,
+ "%s: %s", error, r->filename);
/* XXX Very expensive mainline case! Open, then getfileinfo! */
- if (!conf->logname ||
- ((stat(conf->logname, &finfo) == 0)
- && (finfo.st_size > conf->logbytes)) ||
+ if (!conf->logname ||
+ ((stat(conf->logname, &finfo) == 0)
+ && (finfo.st_size > conf->logbytes)) ||
(apr_file_open(&f, conf->logname,
- APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) {
- return ret;
- }
+ APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) {
+ return ret;
+ }
- /* "%% [Wed Jun 19 10:53:21 1996] GET /cgid-bin/printenv HTTP/1.0" */
+ /* "%% [Wed Jun 19 10:53:21 1996] GET /cgid-bin/printenv HTTP/1.0" */
apr_ctime(time_str, apr_time_now());
- apr_file_printf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri,
- r->args ? "?" : "", r->args ? r->args : "", r->protocol);
- /* "%% 500 /usr/local/apache/cgid-bin */
- apr_file_printf(f, "%%%% %d %s\n", ret, r->filename);
-
- apr_file_printf(f, "%%error\n%s\n", error);
-
- apr_file_close(f);
- return ret;
-}
+ apr_file_printf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri,
+ r->args ? "?" : "", r->args ? r->args : "", r->protocol);
+ /* "%% 500 /usr/local/apache/cgid-bin */
+ apr_file_printf(f, "%%%% %d %s\n", ret, r->filename);
+
+ apr_file_printf(f, "%%error\n%s\n", error);
+
+ apr_file_close(f);
+ return ret;
+}
-static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
+static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
char *dbuf, const char *sbuf, apr_bucket_brigade *bb,
- apr_file_t *script_err)
-{
- const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
- const apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
- char argsbuffer[HUGE_STRING_LEN];
- apr_file_t *f = NULL;
+ apr_file_t *script_err)
+{
+ const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
+ const apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
+ char argsbuffer[HUGE_STRING_LEN];
+ apr_file_t *f = NULL;
apr_bucket *e;
const char *buf;
apr_size_t len;
apr_status_t rv;
int first;
- int i;
- struct stat finfo;
+ int i;
+ struct stat finfo;
char time_str[APR_CTIME_LEN];
/* XXX Very expensive mainline case! Open, then getfileinfo! */
- if (!conf->logname ||
- ((stat(conf->logname, &finfo) == 0)
- && (finfo.st_size > conf->logbytes)) ||
- (apr_file_open(&f, conf->logname,
- APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) {
- /* Soak up script output */
+ if (!conf->logname ||
+ ((stat(conf->logname, &finfo) == 0)
+ && (finfo.st_size > conf->logbytes)) ||
+ (apr_file_open(&f, conf->logname,
+ APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) {
+ /* Soak up script output */
discard_script_output(bb);
if (script_err) {
- while (apr_file_gets(argsbuffer, HUGE_STRING_LEN,
- script_err) == APR_SUCCESS)
- continue;
+ while (apr_file_gets(argsbuffer, HUGE_STRING_LEN,
+ script_err) == APR_SUCCESS)
+ continue;
}
- return ret;
- }
+ return ret;
+ }
- /* "%% [Wed Jun 19 10:53:21 1996] GET /cgid-bin/printenv HTTP/1.0" */
+ /* "%% [Wed Jun 19 10:53:21 1996] GET /cgid-bin/printenv HTTP/1.0" */
apr_ctime(time_str, apr_time_now());
- apr_file_printf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri,
- r->args ? "?" : "", r->args ? r->args : "", r->protocol);
- /* "%% 500 /usr/local/apache/cgid-bin" */
- apr_file_printf(f, "%%%% %d %s\n", ret, r->filename);
-
- apr_file_puts("%request\n", f);
- for (i = 0; i < hdrs_arr->nelts; ++i) {
- if (!hdrs[i].key)
- continue;
- apr_file_printf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val);
- }
- if ((r->method_number == M_POST || r->method_number == M_PUT)
- && *dbuf) {
- apr_file_printf(f, "\n%s\n", dbuf);
- }
-
- apr_file_puts("%response\n", f);
- hdrs_arr = apr_table_elts(r->err_headers_out);
- hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
-
- for (i = 0; i < hdrs_arr->nelts; ++i) {
- if (!hdrs[i].key)
- continue;
- apr_file_printf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val);
- }
+ apr_file_printf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri,
+ r->args ? "?" : "", r->args ? r->args : "", r->protocol);
+ /* "%% 500 /usr/local/apache/cgid-bin" */
+ apr_file_printf(f, "%%%% %d %s\n", ret, r->filename);
+
+ apr_file_puts("%request\n", f);
+ for (i = 0; i < hdrs_arr->nelts; ++i) {
+ if (!hdrs[i].key)
+ continue;
+ apr_file_printf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val);
+ }
+ if ((r->method_number == M_POST || r->method_number == M_PUT)
+ && *dbuf) {
+ apr_file_printf(f, "\n%s\n", dbuf);
+ }
- if (sbuf && *sbuf)
- apr_file_printf(f, "%s\n", sbuf);
+ apr_file_puts("%response\n", f);
+ hdrs_arr = apr_table_elts(r->err_headers_out);
+ hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
+
+ for (i = 0; i < hdrs_arr->nelts; ++i) {
+ if (!hdrs[i].key)
+ continue;
+ apr_file_printf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val);
+ }
+
+ if (sbuf && *sbuf)
+ apr_file_printf(f, "%s\n", sbuf);
first = 1;
@@ -1072,29 +1072,29 @@
}
if (script_err) {
- if (apr_file_gets(argsbuffer, HUGE_STRING_LEN,
- script_err) == APR_SUCCESS) {
- apr_file_puts("%stderr\n", f);
- apr_file_puts(argsbuffer, f);
- while (apr_file_gets(argsbuffer, HUGE_STRING_LEN,
- script_err) == APR_SUCCESS)
- apr_file_puts(argsbuffer, f);
- apr_file_puts("\n", f);
- }
+ if (apr_file_gets(argsbuffer, HUGE_STRING_LEN,
+ script_err) == APR_SUCCESS) {
+ apr_file_puts("%stderr\n", f);
+ apr_file_puts(argsbuffer, f);
+ while (apr_file_gets(argsbuffer, HUGE_STRING_LEN,
+ script_err) == APR_SUCCESS)
+ apr_file_puts(argsbuffer, f);
+ apr_file_puts("\n", f);
+ }
}
if (script_err) {
- apr_file_close(script_err);
+ apr_file_close(script_err);
}
- apr_file_close(f);
- return ret;
-}
+ apr_file_close(f);
+ return ret;
+}
static apr_status_t close_unix_socket(void *thefd)
{
int fd = (int)((long)thefd);
-
+
return close(fd);
}
@@ -1115,7 +1115,7 @@
while (1) {
++connect_tries;
if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
- return log_scripterror(r, conf, HTTP_INTERNAL_SERVER_ERROR, errno,
+ return log_scripterror(r, conf, HTTP_INTERNAL_SERVER_ERROR, errno,
"unable to create socket to cgi daemon");
}
if (connect(sd, (struct sockaddr *)&unix_addr, sizeof(unix_addr)) < 0) {
@@ -1131,7 +1131,7 @@
}
else {
close(sd);
- return log_scripterror(r, conf, HTTP_SERVICE_UNAVAILABLE, errno,
+ return log_scripterror(r, conf, HTTP_SERVICE_UNAVAILABLE, errno,
"unable to connect to cgi daemon after multiple tries");
}
}
@@ -1171,10 +1171,10 @@
}
}
-/****************************************************************
- *
- * Actual cgid handling...
- */
+/****************************************************************
+ *
+ * Actual cgid handling...
+ */
struct cleanup_script_info {
request_rec *r;
@@ -1271,18 +1271,18 @@
return cleanup_nonchild_process(info->r, pid);
}
-static int cgid_handler(request_rec *r)
-{
+static int cgid_handler(request_rec *r)
+{
conn_rec *c = r->connection;
- int retval, nph, dbpos = 0;
- char *argv0, *dbuf = NULL;
+ int retval, nph, dbpos = 0;
+ char *argv0, *dbuf = NULL;
apr_bucket_brigade *bb;
apr_bucket *b;
cgid_server_conf *conf;
int is_included;
int seen_eos, child_stopped_reading;
int sd;
- char **env;
+ char **env;
apr_file_t *tempsock;
struct cleanup_script_info *info;
apr_status_t rv;
@@ -1290,36 +1290,36 @@
if (strcmp(r->handler,CGI_MAGIC_TYPE) && strcmp(r->handler,"cgi-script"))
return DECLINED;
- conf = ap_get_module_config(r->server->module_config, &cgid_module);
- is_included = !strcmp(r->protocol, "INCLUDED");
+ conf = ap_get_module_config(r->server->module_config, &cgid_module);
+ is_included = !strcmp(r->protocol, "INCLUDED");
if ((argv0 = strrchr(r->filename, '/')) != NULL)
argv0++;
else
argv0 = r->filename;
-
- nph = !(strncmp(argv0, "nph-", 4));
- argv0 = r->filename;
+ nph = !(strncmp(argv0, "nph-", 4));
- if (!(ap_allow_options(r) & OPT_EXECCGI) && !is_scriptaliased(r))
- return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
- "Options ExecCGI is off in this directory");
- if (nph && is_included)
- return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
- "attempt to include NPH CGI script");
+ argv0 = r->filename;
+
+ if (!(ap_allow_options(r) & OPT_EXECCGI) && !is_scriptaliased(r))
+ return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
+ "Options ExecCGI is off in this directory");
+ if (nph && is_included)
+ return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
+ "attempt to include NPH CGI script");
#if defined(OS2) || defined(WIN32)
-#error mod_cgid does not work on this platform. If you teach it to, look
+#error mod_cgid does not work on this platform. If you teach it to, look
#error at mod_cgi.c for required code in this path.
-#else
- if (r->finfo.filetype == 0)
- return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
- "script not found or unable to stat");
-#endif
- if (r->finfo.filetype == APR_DIR)
- return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
- "attempt to invoke directory as script");
+#else
+ if (r->finfo.filetype == 0)
+ return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
+ "script not found or unable to stat");
+#endif
+ if (r->finfo.filetype == APR_DIR)
+ return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
+ "attempt to invoke directory as script");
if ((r->used_path_info == AP_REQ_REJECT_PATH_INFO) &&
r->path_info && *r->path_info)
@@ -1329,21 +1329,21 @@
"AcceptPathInfo off disallows user's path");
}
/*
- if (!ap_suexec_enabled) {
- if (!ap_can_exec(&r->finfo))
- return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
- "file permissions deny server execution");
- }
+ if (!ap_suexec_enabled) {
+ if (!ap_can_exec(&r->finfo))
+ return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
+ "file permissions deny server execution");
+ }
*/
- ap_add_common_vars(r);
- ap_add_cgi_vars(r);
- env = ap_create_environment(r->pool, r->subprocess_env);
+ ap_add_common_vars(r);
+ ap_add_cgi_vars(r);
+ env = ap_create_environment(r->pool, r->subprocess_env);
if ((retval = connect_to_daemon(&sd, r, conf)) != OK) {
return retval;
}
- rv = send_req(sd, r, argv0, env, CGI_REQ);
+ rv = send_req(sd, r, argv0, env, CGI_REQ);
if (rv != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"write to cgi daemon process");
@@ -1361,18 +1361,18 @@
* a cleanup for the apr_file_t which will close the socket, so we'll
* get rid of the cleanup we registered when we created the socket.
*/
-
+
apr_os_pipe_put_ex(&tempsock, &sd, 1, r->pool);
apr_pool_cleanup_kill(r->pool, (void *)((long)sd), close_unix_socket);
- if ((argv0 = strrchr(r->filename, '/')) != NULL)
- argv0++;
- else
- argv0 = r->filename;
-
- /* Transfer any put/post args, CERN style...
- * Note that we already ignore SIGPIPE in the core server.
- */
+ if ((argv0 = strrchr(r->filename, '/')) != NULL)
+ argv0++;
+ else
+ argv0 = r->filename;
+
+ /* Transfer any put/post args, CERN style...
+ * Note that we already ignore SIGPIPE in the core server.
+ */
bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
seen_eos = 0;
child_stopped_reading = 0;
@@ -1385,11 +1385,11 @@
rv = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES,
APR_BLOCK_READ, HUGE_STRING_LEN);
-
+
if (rv != APR_SUCCESS) {
return rv;
}
-
+
for (bucket = APR_BRIGADE_FIRST(bb);
bucket != APR_BRIGADE_SENTINEL(bb);
bucket = APR_BUCKET_NEXT(bucket))
@@ -1410,11 +1410,11 @@
/* If the child stopped, we still must read to EOS. */
if (child_stopped_reading) {
continue;
- }
+ }
/* read */
apr_bucket_read(bucket, &data, &len, APR_BLOCK_READ);
-
+
if (conf->logname && dbpos < conf->bufbytes) {
int cursize;
@@ -1441,7 +1441,7 @@
apr_brigade_cleanup(bb);
}
while (!seen_eos);
-
+
if (conf->logname) {
dbuf[dbpos] = '\0';
}
@@ -1452,11 +1452,11 @@
*/
shutdown(sd, 1);
- /* Handle script return... */
- if (!nph) {
- const char *location;
- char sbuf[MAX_STRING_LEN];
- int ret;
+ /* Handle script return... */
+ if (!nph) {
+ const char *location;
+ char sbuf[MAX_STRING_LEN];
+ int ret;
bb = apr_brigade_create(r->pool, c->bucket_alloc);
b = apr_bucket_pipe_create(tempsock, c->bucket_alloc);
@@ -1464,47 +1464,47 @@
b = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
- if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) {
- return log_script(r, conf, ret, dbuf, sbuf, bb, NULL);
- }
+ if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) {
+ return log_script(r, conf, ret, dbuf, sbuf, bb, NULL);
+ }
- location = apr_table_get(r->headers_out, "Location");
+ location = apr_table_get(r->headers_out, "Location");
- if (location && location[0] == '/' && r->status == 200) {
+ if (location && location[0] == '/' && r->status == 200) {
/* Soak up all the script output */
discard_script_output(bb);
apr_brigade_destroy(bb);
- /* This redirect needs to be a GET no matter what the original
- * method was.
- */
- r->method = apr_pstrdup(r->pool, "GET");
- r->method_number = M_GET;
-
- /* We already read the message body (if any), so don't allow
- * the redirected request to think it has one. We can ignore
- * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR.
- */
- apr_table_unset(r->headers_in, "Content-Length");
-
- ap_internal_redirect_handler(location, r);
- return OK;
- }
- else if (location && r->status == 200) {
- /* XX Note that if a script wants to produce its own Redirect
- * body, it now has to explicitly *say* "Status: 302"
- */
+ /* This redirect needs to be a GET no matter what the original
+ * method was.
+ */
+ r->method = apr_pstrdup(r->pool, "GET");
+ r->method_number = M_GET;
+
+ /* We already read the message body (if any), so don't allow
+ * the redirected request to think it has one. We can ignore
+ * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR.
+ */
+ apr_table_unset(r->headers_in, "Content-Length");
+
+ ap_internal_redirect_handler(location, r);
+ return OK;
+ }
+ else if (location && r->status == 200) {
+ /* XX Note that if a script wants to produce its own Redirect
+ * body, it now has to explicitly *say* "Status: 302"
+ */
discard_script_output(bb);
apr_brigade_destroy(bb);
- return HTTP_MOVED_TEMPORARILY;
- }
+ return HTTP_MOVED_TEMPORARILY;
+ }
ap_pass_brigade(r->output_filters, bb);
- }
+ }
if (nph) {
struct ap_filter_t *cur;
-
+
/* get rid of all filters up through protocol... since we
* haven't parsed off the headers, there is no way they can
* work
@@ -1522,10 +1522,10 @@
b = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
ap_pass_brigade(r->output_filters, bb);
- }
+ }
- return OK; /* NOT r->status, even if it has changed. */
-}
+ return OK; /* NOT r->status, even if it has changed. */
+}
@@ -1622,13 +1622,13 @@
static int include_cmd(include_ctx_t *ctx, ap_filter_t *f,
apr_bucket_brigade *bb, char *command)
{
- char **env;
+ char **env;
int sd;
int retval;
apr_file_t *tempsock = NULL;
request_rec *r = f->r;
cgid_server_conf *conf = ap_get_module_config(r->server->module_config,
- &cgid_module);
+ &cgid_module);
struct cleanup_script_info *info;
add_ssi_vars(r);
@@ -1638,14 +1638,14 @@
return retval;
}
- send_req(sd, r, command, env, SSI_REQ);
+ send_req(sd, r, command, env, SSI_REQ);
info = apr_palloc(r->pool, sizeof(struct cleanup_script_info));
info->r = r;
info->conn_id = r->connection->id;
info->conf = conf;
/* for this type of request, the script is invoked through an
- * intermediate shell process... cleanup_script is only able
+ * intermediate shell process... cleanup_script is only able
* to knock out the shell process, not the actual script
*/
apr_pool_cleanup_register(r->pool, info,
@@ -1761,13 +1761,13 @@
ap_hook_handler(cgid_handler, NULL, NULL, APR_HOOK_MIDDLE);
}
-module AP_MODULE_DECLARE_DATA cgid_module = {
- STANDARD20_MODULE_STUFF,
- NULL, /* dir config creater */
- NULL, /* dir merger --- default is to override */
- create_cgid_config, /* server config */
- merge_cgid_config, /* merge server config */
- cgid_cmds, /* command table */
- register_hook /* register_handlers */
-};
+module AP_MODULE_DECLARE_DATA cgid_module = {
+ STANDARD20_MODULE_STUFF,
+ NULL, /* dir config creater */
+ NULL, /* dir merger --- default is to override */
+ create_cgid_config, /* server config */
+ merge_cgid_config, /* merge server config */
+ cgid_cmds, /* command table */
+ register_hook /* register_handlers */
+};
Modified: httpd/httpd/branches/2.2.x/modules/generators/mod_info.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/generators/mod_info.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/generators/mod_info.c (original)
+++ httpd/httpd/branches/2.2.x/modules/generators/mod_info.c Thu Nov 10 07:20:05 2005
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/*
+/*
* Info Module. Display configuration information for the server and
* all included modules.
*
@@ -29,15 +29,15 @@
* GET /server-info?config - Returns full configuration
* GET /server-info?hooks - Returns a listing of the modules active for each hook
*
- * Original Author:
+ * Original Author:
* Rasmus Lerdorf <rasmus vex.net>, May 1996
*
- * Modified By:
+ * Modified By:
* Lou Langholtz <ldl usi.utah.edu>, July 1997
*
* Apache 2.0 Port:
* Ryan Morgan <rmorgan covalent.net>, August 2000
- *
+ *
*/
@@ -220,7 +220,7 @@
* hook_get_t is a pointer to a function that takes void as an argument and
* returns a pointer to an apr_array_header_t. The nasty WIN32 ifdef
* is required to account for the fact that the ap_hook* calls all use
- * STDCALL calling convention.
+ * STDCALL calling convention.
*/
typedef apr_array_header_t *(
#ifdef WIN32
@@ -387,8 +387,8 @@
ap_rputs("<dt><strong>Server Built With:</strong>\n"
"<tt style=\"white-space: pre;\">\n", r);
- /* TODO: Not all of these defines are getting set like they do in main.c.
- * Missing some headers?
+ /* TODO: Not all of these defines are getting set like they do in main.c.
+ * Missing some headers?
*/
#ifdef BIG_SECURITY_HOLE
Modified: httpd/httpd/branches/2.2.x/modules/generators/mod_status.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/generators/mod_status.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/generators/mod_status.c (original)
+++ httpd/httpd/branches/2.2.x/modules/generators/mod_status.c Thu Nov 10 07:20:05 2005
@@ -233,7 +233,7 @@
clock_t tu, ts, tcu, tcs;
ap_generation_t worker_generation;
- if (strcmp(r->handler, STATUS_MAGIC_TYPE) &&
+ if (strcmp(r->handler, STATUS_MAGIC_TYPE) &&
strcmp(r->handler, "server-status")) {
return DECLINED;
}
@@ -288,7 +288,7 @@
+ 1) > 0)
apr_table_set(r->headers_out,
status_options[i].hdr_out_str,
- loc +
+ loc +
strlen(status_options[i].hdr_out_str) +
1);
else
@@ -314,7 +314,7 @@
clock_t proc_tu = 0, proc_ts = 0, proc_tcu = 0, proc_tcs = 0;
clock_t tmp_tu, tmp_ts, tmp_tcu, tmp_tcs;
#endif
-
+
ps_record = ap_get_scoreboard_process(i);
for (j = 0; j < thread_limit; ++j) {
int indx = (i * thread_limit) + j;
@@ -574,7 +574,7 @@
req_time = 0L;
else
req_time = (long)
- ((ws_record->stop_time -
+ ((ws_record->stop_time -
ws_record->start_time) / 1000);
if (req_time < 0L)
req_time = 0L;
@@ -593,7 +593,7 @@
worker_pid = ps_record->pid;
worker_generation = ps_record->generation;
}
-
+
if (no_table_report) {
if (ws_record->status == SERVER_DEAD)
ap_rprintf(r,
@@ -607,7 +607,7 @@
i, (int) worker_generation,
worker_pid,
(int)conn_lres, my_lres, lres);
-
+
switch (ws_record->status) {
case SERVER_READY:
ap_rputs("Ready", r);
@@ -646,7 +646,7 @@
ap_rputs("?STATE?", r);
break;
}
-
+
ap_rprintf(r, "] "
#ifdef HAVE_TIMES
"u%g s%g cu%g cs%g"
@@ -692,7 +692,7 @@
worker_pid,
(int)conn_lres,
my_lres, lres);
-
+
switch (ws_record->status) {
case SERVER_READY:
ap_rputs("</td><td>_", r);
@@ -731,7 +731,7 @@
ap_rputs("</td><td>?", r);
break;
}
-
+
ap_rprintf(r,
"\n</td>"
#ifdef HAVE_TIMES
@@ -747,11 +747,11 @@
(long)apr_time_sec(nowtime -
ws_record->last_used),
(long)req_time);
-
+
ap_rprintf(r, "</td><td>%-1.1f</td><td>%-2.2f</td><td>%-2.2f\n",
(float)conn_bytes / KBYTE, (float) my_bytes / MBYTE,
(float)bytes / MBYTE);
-
+
if (ws_record->status == SERVER_BUSY_READ)
ap_rprintf(r,
"</td><td>?</td><td nowrap>?</td><td nowrap>..reading.. </td></tr>\n\n");
@@ -800,11 +800,11 @@
{
/* Run extension hooks to insert extra content. */
- int flags =
- (short_report ? AP_STATUS_SHORT : 0) |
+ int flags =
+ (short_report ? AP_STATUS_SHORT : 0) |
(no_table_report ? AP_STATUS_NOTABLE : 0) |
(ap_extended_status ? AP_STATUS_EXTENDED : 0);
-
+
ap_run_status_hook(r, flags);
}
Modified: httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c Thu Nov 10 07:20:05 2005
@@ -170,29 +170,29 @@
}
num_ranges = ap_set_byterange(r);
-
+
/* We have nothing to do, get out of the way. */
if (num_ranges == 0) {
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
-
+
ctx = apr_pcalloc(r->pool, sizeof(*ctx));
ctx->num_ranges = num_ranges;
/* create a brigade in case we never call ap_save_brigade() */
ctx->bb = apr_brigade_create(r->pool, c->bucket_alloc);
-
+
if (ctx->num_ranges > 1) {
/* Is ap_make_content_type required here? */
const char *orig_ct = ap_make_content_type(r, r->content_type);
ctx->boundary = apr_psprintf(r->pool, "%" APR_UINT64_T_HEX_FMT "%lx",
(apr_uint64_t)r->request_time, (long) getpid());
-
+
ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
use_range_x(r) ? "/x-" : "/",
"byteranges; boundary=",
ctx->boundary, NULL));
-
+
ctx->bound_head = apr_pstrcat(r->pool,
CRLF "--", ctx->boundary,
CRLF "Content-type: ",
Modified: httpd/httpd/branches/2.2.x/modules/http/chunk_filter.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/http/chunk_filter.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/chunk_filter.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/chunk_filter.c Thu Nov 10 07:20:05 2005
@@ -52,7 +52,7 @@
apr_off_t bytes = 0;
apr_bucket *eos = NULL;
apr_bucket *flush = NULL;
- /* XXX: chunk_hdr must remain at this scope since it is used in a
+ /* XXX: chunk_hdr must remain at this scope since it is used in a
* transient bucket.
*/
char chunk_hdr[20]; /* enough space for the snprintf below */
Modified: httpd/httpd/branches/2.2.x/modules/http/http_core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/http/http_core.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/http_core.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/http_core.c Thu Nov 10 07:20:05 2005
@@ -54,7 +54,7 @@
}
static const char *set_keep_alive(cmd_parms *cmd, void *dummy,
- const char *arg)
+ const char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
if (err != NULL) {
@@ -110,17 +110,17 @@
{
request_rec *r;
conn_state_t *cs = c->cs;
-
+
AP_DEBUG_ASSERT(cs->state == CONN_STATE_READ_REQUEST_LINE);
-
+
while (cs->state == CONN_STATE_READ_REQUEST_LINE) {
ap_update_child_status(c->sbh, SERVER_BUSY_READ, NULL);
-
+
if ((r = ap_read_request(c))) {
c->keepalive = AP_CONN_UNKNOWN;
/* process the request if it was read without error */
-
+
ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
if (r->status == HTTP_OK)
ap_process_request(r);
@@ -128,7 +128,7 @@
if (ap_extended_status)
ap_increment_counts(c->sbh, r);
- if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted
+ if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted
|| ap_graceful_stop_signalled()) {
cs->state = CONN_STATE_LINGER;
}
@@ -159,26 +159,26 @@
* Read and process each request found on our connection
* until no requests are left or we decide to close.
*/
-
+
ap_update_child_status(c->sbh, SERVER_BUSY_READ, NULL);
while ((r = ap_read_request(c)) != NULL) {
c->keepalive = AP_CONN_UNKNOWN;
/* process the request if it was read without error */
-
+
ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
if (r->status == HTTP_OK)
ap_process_request(r);
-
+
if (ap_extended_status)
ap_increment_counts(c->sbh, r);
-
+
if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted)
break;
-
+
ap_update_child_status(c->sbh, SERVER_BUSY_KEEPALIVE, r);
apr_pool_destroy(r->pool);
-
+
if (ap_graceful_stop_signalled())
break;
@@ -189,7 +189,7 @@
apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
/* Go straight to select() to wait for the next request */
}
-
+
return OK;
}
@@ -214,13 +214,13 @@
* use a different processing function
*/
int async_mpm = 0;
- if (ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm) == APR_SUCCESS
+ if (ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm) == APR_SUCCESS
&& async_mpm == 1) {
ap_hook_process_connection(ap_process_http_async_connection, NULL,
NULL, APR_HOOK_REALLY_LAST);
}
else {
- ap_hook_process_connection(ap_process_http_connection, NULL, NULL,
+ ap_hook_process_connection(ap_process_http_connection, NULL, NULL,
APR_HOOK_REALLY_LAST);
}
@@ -232,7 +232,7 @@
ap_register_input_filter("HTTP_IN", ap_http_filter,
NULL, AP_FTYPE_PROTOCOL);
ap_http_header_filter_handle =
- ap_register_output_filter("HTTP_HEADER", ap_http_header_filter,
+ ap_register_output_filter("HTTP_HEADER", ap_http_header_filter,
NULL, AP_FTYPE_PROTOCOL);
ap_chunk_filter_handle =
ap_register_output_filter("CHUNK", ap_http_chunk_filter,
Modified: httpd/httpd/branches/2.2.x/modules/http/http_etag.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/http/http_etag.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/http_etag.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/http_etag.c Thu Nov 10 07:20:05 2005
@@ -73,7 +73,7 @@
cfg = (core_dir_config *)ap_get_module_config(r->per_dir_config,
&core_module);
etag_bits = (cfg->etag_bits & (~ cfg->etag_remove)) | cfg->etag_add;
-
+
/*
* If it's a file (or we wouldn't be here) and no ETags
* should be set for files, return an empty string and
@@ -173,7 +173,7 @@
if (!r->vlist_validator) {
etag = ap_make_etag(r, 0);
-
+
/* If we get a blank etag back, don't set the header. */
if (!etag[0]) {
return;