Permalink
Browse files

all headers are handled by ap_add_common_vars, no need for FastCgiPas…

…sHeaders
  • Loading branch information...
1 parent 902d573 commit 41d10bf4cbb24daff2e32d9185d062c8eeaa6dd9 @hollow committed Jun 19, 2010
Showing with 6 additions and 22 deletions.
  1. +4 −4 fcgi_server.c
  2. +2 −17 mod_fastcgi_handler.c
  3. +0 −1 mod_fastcgi_handler.h
View
8 fcgi_server.c
@@ -161,8 +161,9 @@ char *fcgi_original_uri(request_rec *r)
}
static
-void fcgi_add_cgi_vars(request_rec *r)
+void fcgi_add_cgi_vars(fcgi_request_t *fr)
{
+ request_rec *r = fr->r;
apr_table_t *e = r->subprocess_env;
apr_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
@@ -199,16 +200,15 @@ void fcgi_add_cgi_vars(request_rec *r)
const char *script_name = apr_table_get(e, "SCRIPT_NAME");
apr_table_setn(e, "SCRIPT_FILENAME", apr_pstrcat(r->pool, document_root, script_name, NULL));
- apr_table_setn(e, "PATH_TRANSLATED",apr_pstrcat(r->pool, document_root, script_name, NULL));
+ apr_table_setn(e, "PATH_TRANSLATED", apr_pstrcat(r->pool, document_root, script_name, NULL));
}
int fcgi_server_send_params_record(fcgi_request_t *fr, uint16_t request_id,
void *record_buffer)
{
/* add all environment variables to r->subprocess_env */
ap_add_common_vars(fr->r);
- fcgi_add_cgi_vars(fr->r);
- /* TODO: FastCgiPassHeader */
+ fcgi_add_cgi_vars(fr);
/* build FCGI_PARAMS record based on apache environement */
apr_pool_t *p = fr->r->pool;
View
19 mod_fastcgi_handler.c
@@ -4,7 +4,7 @@
#include "fcgi_server.h"
static
-int fastcgi_handler_handler(request_rec *r)
+int fastcgi_handler(request_rec *r)
{
if (strncmp(r->handler, "fcgi:", 5))
return DECLINED;
@@ -32,7 +32,6 @@ void *fastcgi_handler_create_dir_config(apr_pool_t *p, char *dir)
fastcgi_handler_cfg *cfg = apr_pcalloc(p, sizeof(fastcgi_handler_cfg));
cfg->idle_timeout = -1;
- cfg->headers = apr_array_make(p, 1, sizeof(char *));
return cfg;
}
@@ -47,33 +46,19 @@ void *fastcgi_handler_merge_dir_config(apr_pool_t *p, void *parent, void *curren
cfg->idle_timeout = current_cfg->idle_timeout == -1 ?
parent_cfg->idle_timeout : current_cfg->idle_timeout;
- cfg->headers = apr_array_append(p, parent_cfg->headers, current_cfg->headers);
-
return cfg;
}
static
-const char *fastcgi_handler_cmd_pass_header(cmd_parms *cmd, void *mconf,
- const char *arg)
-{
- fastcgi_handler_cfg *cfg = (fastcgi_handler_cfg *) mconf;
- *(const char **)apr_array_push(cfg->headers) = arg;
- return NULL;
-}
-
-static
const command_rec fastcgi_handler_cmds[] =
{
- AP_INIT_ITERATE("FastCgiPassHeader", fastcgi_handler_cmd_pass_header, NULL,
- OR_FILEINFO, "a list of headers to pass to the FastCGI application."),
-
{ NULL }
};
static
void fastcgi_handler_register_hooks(apr_pool_t * p)
{
- ap_hook_handler(fastcgi_handler_handler, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_handler(fastcgi_handler, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA fastcgi_handler_module =
View
1 mod_fastcgi_handler.h
@@ -10,7 +10,6 @@
typedef struct {
int idle_timeout;
- apr_array_header_t *headers;
} fastcgi_handler_cfg;
extern module MODULE_VAR_EXPORT fastcgi_handler_module;

0 comments on commit 41d10bf

Please sign in to comment.