--- parser3/src/targets/apache/mod_parser3.c 2012/04/18 18:58:33 1.14 +++ parser3/src/targets/apache/mod_parser3.c 2026/04/25 13:38:46 1.26 @@ -1,14 +1,10 @@ /** @file Parser: apache 1.3 and 2.2 module - Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ -#ifdef WIN32 -#include -#endif - #include "httpd.h" #include "http_config.h" #include "http_core.h" @@ -19,7 +15,7 @@ #include "pa_httpd.h" -volatile const char * IDENT_MOD_PARSER3_C="$Id: mod_parser3.c,v 1.14 2012/04/18 18:58:33 moko Exp $" IDENT_PA_HTTPD_H; +volatile const char * IDENT_MOD_PARSER3_C="$Id: mod_parser3.c,v 1.26 2026/04/25 13:38:46 moko Exp $" IDENT_PA_HTTPD_H; #define PARSER3_HANDLER "parser3-handler" @@ -83,7 +79,7 @@ static int parser_handler(request_rec *r return DECLINED; if(is_threaded){ - const char *message="Parser3 module requires apache2-mpm-prefork"; + const char *message="Parser3 module requires 'a2enmod mpm_prefork'"; r->status=HTTP_INTERNAL_SERVER_ERROR; r->content_type="text/plain"; ap_rwrite(message, strlen(message), r); @@ -94,27 +90,29 @@ static int parser_handler(request_rec *r // we setup module here to avoid GPF on init with php5-xsl installed pa_setup_module_cells(); - // converting to parser version - pa_request_rec pr={ - r, - r->pool, - r->header_only, - &r->status, - r->method, - r->headers_out, - r->subprocess_env, - &r->content_type, - r->uri, - r->filename, - r->path_info, - r->args, + { + // converting to parser version + pa_request_rec pr={ + r, + r->pool, + r->header_only, + &r->status, + r->method, + r->headers_out, + r->subprocess_env, + &r->content_type, + r->uri, + r->filename, + r->path_info, + r->args, #ifdef STANDARD20_MODULE_STUFF - r->finfo.filetype == 0 + r->finfo.filetype == 0 #else - r->finfo.st_mode == 0 + r->finfo.st_mode == 0 #endif - }; - return pa_parser_handler(&pr, our_dconfig(r)); + }; + return pa_parser_handler(&pr, our_dconfig(r)); + } } /* @@ -159,7 +157,7 @@ static void *parser_create_server_config */ static const command_rec parser_cmds[] = { - {"ParserConfig", (const char *(*)())cmd_parser_config, 0, OR_OPTIONS, TAKE1, "Parser config filespec"}, + {"ParserConfig", (const char *(*)(cmd_parms *, void *))cmd_parser_config, 0, OR_OPTIONS, TAKE1, "Parser config filespec"}, {NULL} }; @@ -225,11 +223,13 @@ module MODULE_VAR_EXPORT parser3_module }; #if defined(_MSC_VER) -# define APACHE_WIN32_SRC "../../../../win32/apache13/src" +# define APACHE_WIN32_SRC "../../../../win32/apache22/" # ifdef _DEBUG -# pragma comment(lib, APACHE_WIN32_SRC "/CoreD/ApacheCore.lib") +# pragma comment(lib, APACHE_WIN32_SRC "srclib/apr/Debug/libapr-1.lib") +# pragma comment(lib, APACHE_WIN32_SRC "Debug/libhttpd.lib") # else -# pragma comment(lib, APACHE_WIN32_SRC "/CoreR/ApacheCore.lib") +# pragma comment(lib, APACHE_WIN32_SRC "srclib/apr/Release/libapr-1.lib") +# pragma comment(lib, APACHE_WIN32_SRC "Release/libhttpd.lib") # endif #endif @@ -243,7 +243,11 @@ void pa_ap_log_rerror(const char *file, str=va_arg(l, const char*); va_end(l); - ap_log_rerror(file, line, level, + ap_log_rerror(file, line, +#if (AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER >= 4) + APLOG_MODULE_INDEX, +#endif + level, #ifdef STANDARD20_MODULE_STUFF 0, #endif @@ -258,7 +262,11 @@ void pa_ap_log_error(const char *file, i str=va_arg(l, const char*); va_end(l); - ap_log_error(file, line, level, + ap_log_error(file, line, +#if (AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER >= 4) + APLOG_MODULE_INDEX, +#endif + level, #ifdef STANDARD20_MODULE_STUFF 0, #endif @@ -337,13 +345,12 @@ void pa_ap_add_common_vars(pa_request_re ap_add_common_vars((request_rec*)r->real_request_rec); } -#ifndef WIN32 // signal.h void (*pa_signal (int sig, void (*disp)(int)))(int) { +#ifndef _MSC_VER if(sig==PA_SIGPIPE && disp==PA_SIG_IGN) return signal(SIGPIPE, SIG_IGN); - +#endif return 0; } -#endif