--- parser3/src/targets/apache13/Attic/mod_parser3.c 2003/07/23 12:10:09 1.1.2.4 +++ parser3/src/targets/apache13/Attic/mod_parser3.c 2012/03/16 09:24:15 1.13 @@ -1,11 +1,13 @@ /** @file Parser: apache 1.3 module, part, compiled by Apache. - Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_MOD_PARSER3_C="$Date: 2003/07/23 12:10:09 $"; +#ifdef WIN32 +#include +#endif #include "httpd.h" #include "http_config.h" @@ -19,6 +21,8 @@ static const char* IDENT_MOD_PARSER3_C=" #include "pa_httpd.h" +volatile const char * IDENT_MOD_PARSER3_C="$Id: mod_parser3.c,v 1.13 2012/03/16 09:24:15 moko Exp $" IDENT_PA_HTTPD_H; + /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. @@ -45,7 +49,7 @@ static const char* cmd_parser_status_all //_asm int 3; Parser_module_config *cfg = (Parser_module_config *) mconfig; - cfg->parser_status_allowed=true; + cfg->parser_status_allowed=1; return NULL; } @@ -109,15 +113,15 @@ static const char* cmd_parser_status_all static int parser_handler(request_rec *ar) { // record clone - struct pa_request_rec lr={ + pa_request_rec lr={ ar, ar->pool, ar->header_only, - ar->status, + &ar->status, ar->method, ar->headers_out, ar->subprocess_env, - ar->content_type, + &ar->content_type, ar->uri, ar->filename, ar->path_info, @@ -139,7 +143,7 @@ static int parser_handler(request_rec *a * There is no return value. */ -static void parser_server_init(server_rec *s, pool *p) { +static void parser_module_init(server_rec *s, pool *p) { #if MODULE_MAGIC_NUMBER >= 19980527 ap_add_version_component(pa_version()); #endif @@ -150,6 +154,22 @@ static void parser_server_init(server_re pa_setup_module_cells(); } +/* + * This function is called when an heavy-weight process (such as a child) is + * being run down or destroyed. As with the child-initialisation function, + * any information that needs to be recorded must be in static cells, since + * there's no configuration record. + * + * There is no return value. + */ + +/* + * All our process-death routine does is add its trace to the log. + */ +static void parser_module_done(server_rec *s, pool *p) { + pa_destroy_module_cells(); +} + /* * This function gets called to create a per-directory configuration * record. This will be called for the "default" server environment, and for @@ -403,7 +423,7 @@ static const handler_rec parser_handlers module MODULE_VAR_EXPORT parser3_module = { STANDARD_MODULE_STUFF, - parser_server_init, /* module initializer */ + parser_module_init, /* module initializer */ parser_create_dir_config, /* per-directory config creator */ parser_merge_dir_config, /* dir config merger */ parser_create_server_config, /* server config creator */ @@ -417,10 +437,22 @@ module MODULE_VAR_EXPORT parser3_module 0, /* [7] MIME type checker/setter */ 0, /* [8] fixups */ 0 /* [10] logger */ +#if MODULE_MAGIC_NUMBER >= 19970103 + ,0 /* [3] header parser */ +#endif +#if MODULE_MAGIC_NUMBER >= 19970719 + ,0 /* process initializer */ +#endif +#if MODULE_MAGIC_NUMBER >= 19970728 + ,parser_module_done /* process exit/cleanup */ +#endif +#if MODULE_MAGIC_NUMBER >= 19970902 + ,0 /* [1] post read_request handling */ +#endif }; #if defined(_MSC_VER) -# define APACHE_WIN32_SRC "/parser3project/win32/apache13/src" +# define APACHE_WIN32_SRC "../../../../win32/apache13/src" # ifdef _DEBUG # pragma comment(lib, APACHE_WIN32_SRC "/CoreD/ApacheCore.lib") # else @@ -448,9 +480,10 @@ module MODULE_VAR_EXPORT parser3_module void pa_ap_log_rerror(const char *file, int line, int level, const pa_request_rec *s, const char *fmt, ...) { + const char* str; va_list l; va_start(l, fmt); - const char* str=va_arg(l, const char*); + str=va_arg(l, const char*); va_end(l); ap_log_rerror(file, line, level, @@ -460,9 +493,10 @@ void pa_ap_log_rerror(const char *file, void pa_ap_log_error(const char *file, int line, int level, const pa_server_rec *s, const char *fmt, ...) { + const char* str; va_list l; va_start(l, fmt); - const char* str=va_arg(l, const char*); + str=va_arg(l, const char*); va_end(l); ap_log_error(file, line, level, @@ -471,8 +505,12 @@ void pa_ap_log_error(const char *file, i // ap_alloc.h -const char * pa_ap_table_get(const pa_table *, const char *); -void pa_ap_table_addn(pa_table *, const char *name, const char *val); +const char* pa_ap_table_get(const pa_table *t, const char *name) { + return ap_table_get((const table*)t, name); +} +void pa_ap_table_addn(pa_table *t, const char *name, const char *val) { + ap_table_addn((table*)t, name, val); +} int pa_ap_table_size(const pa_table *t) { return ap_table_elts((const table*)t)->nelts; @@ -500,7 +538,9 @@ long pa_ap_get_client_block(pa_request_r return ap_get_client_block((request_rec*)r->real_request_rec, buffer, bufsiz); } -void pa_ap_send_http_header(pa_request_rec *l); +void pa_ap_send_http_header(pa_request_rec *r) { + ap_send_http_header((request_rec*)r->real_request_rec); +} int pa_ap_rwrite(const void *buf, int nbyte, pa_request_rec *r) { return ap_rwrite(buf, nbyte, (request_rec*)r->real_request_rec); } @@ -531,11 +571,11 @@ void pa_ap_add_common_vars(pa_request_re // ap_md5.h -void pa_MD5Init(AP_MD5_CTX *context) { ap_MD5Init((AP_MD5_CTX*)context); } -void pa_MD5Update(AP_MD5_CTX *context, const unsigned char *input, +void pa_MD5Init(PA_MD5_CTX *context) { ap_MD5Init((AP_MD5_CTX*)context); } +void pa_MD5Update(PA_MD5_CTX *context, const unsigned char *input, unsigned int inputLen) { ap_MD5Update((AP_MD5_CTX *)context, input, inputLen); } void pa_MD5Final(unsigned char digest[MD5_DIGESTSIZE], - AP_MD5_CTX *context) { ap_MD5Final(digest, (AP_MD5_CTX *)context); } + PA_MD5_CTX *context) { ap_MD5Final(digest, (AP_MD5_CTX *)context); } void pa_MD5Encode(const unsigned char *password, const unsigned char *salt, char *result, size_t nbytes) { ap_MD5Encode(password, salt, result, nbytes); }