--- parser3/src/targets/apache13/modules/extra/Attic/mod_parser3.C 2001/05/04 10:42:49 1.33 +++ parser3/src/targets/apache13/modules/extra/Attic/mod_parser3.C 2001/07/25 10:57:58 1.37 @@ -4,9 +4,8 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - - $Id: mod_parser3.C,v 1.33 2001/05/04 10:42:49 paf Exp $ */ +static const char *RCSId="$Id: mod_parser3.C,v 1.37 2001/07/25 10:57:58 parser Exp $"; #include "httpd.h" #include "http_config.h" @@ -24,6 +23,15 @@ #include "pa_version.h" #include "pa_socks.h" +#ifdef _DEBUG +# define DEBUG_PREFIX "debug_" +# define PARSER3_MODULE debug_parser3_module +#else +# define DEBUG_PREFIX +# define PARSER3_MODULE parser3_module +#endif + + /// apache parser module configuration [httpd.conf + .htaccess-es] struct Parser_module_config { const char* parser_root_auto_path; ///< filespec of admin's auto.p file @@ -34,14 +42,14 @@ struct Parser_module_config { * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ -extern "C" module MODULE_VAR_EXPORT parser3_module; +extern "C" module MODULE_VAR_EXPORT PARSER3_MODULE; /* * Locate our directory configuration record for the current request. */ static Parser_module_config *our_dconfig(request_rec *r) { return (Parser_module_config *) - ap_get_module_config(r->per_dir_config, &parser3_module); + ap_get_module_config(r->per_dir_config, &PARSER3_MODULE); } static const char *cmd_parser_auto_path(cmd_parms *cmd, void *mconfig, char *file_spec) { @@ -128,6 +136,9 @@ size_t SAPI::read_post(Pool& pool, char void SAPI::add_header_attribute(Pool& pool, const char *key, const char *value) { request_rec *r=static_cast(pool.context()); + if(strcasecmp(key, "location")==0) + r->status=302; + if(strcasecmp(key, "content-type")==0) { /* r->content_type, *not* r->headers_out("Content-type"). If you don't * set it, it will be filled in with the server's default type (typically @@ -135,7 +146,9 @@ void SAPI::add_header_attribute(Pool& po * case. */ r->content_type = value; - } else + } else if(strcasecmp(key, "status")==0) + r->status=atoi(value); + else ap_table_merge(r->headers_out, key, value); } @@ -505,7 +518,7 @@ static int parser_access_checker(request static const command_rec parser_cmds[] = { { - "parser_root_auto_path", /* directive name */ + DEBUG_PREFIX"parser_root_auto_path", /* directive name */ (const char *(*)(void))((void *)cmd_parser_auto_path), // config action routine (void*)true, /* argument to include in call */ (int)(ACCESS_CONF|RSRC_CONF), /* where available */ @@ -513,7 +526,7 @@ static const command_rec parser_cmds[] = "Parser root auto.p filespec (Admin)" // directive description }, { - "parser_site_auto_path", /* directive name */ + DEBUG_PREFIX"parser_site_auto_path", /* directive name */ (const char *(*)(void))((void *)cmd_parser_auto_path), // config action routine (void*)false, /* argument to include in call */ (int)(OR_OPTIONS), /* where available */ @@ -542,7 +555,7 @@ static const command_rec parser_cmds[] = */ static const handler_rec parser_handlers[] = { - {"parser3-handler", parser_handler}, + {DEBUG_PREFIX"parser3-handler", parser_handler}, {NULL} }; @@ -560,7 +573,7 @@ static const handler_rec parser_handlers * during request processing. Note that not all routines are necessarily * called (such as if a resource doesn't have access restrictions). */ -module MODULE_VAR_EXPORT parser3_module = +module MODULE_VAR_EXPORT PARSER3_MODULE = { STANDARD_MODULE_STUFF, parser_server_init, /* module initializer */