--- parser3/src/targets/apache/mod_parser3_core.C 2010/11/14 22:44:23 1.2 +++ parser3/src/targets/apache/mod_parser3_core.C 2013/07/24 21:37:44 1.9 @@ -1,11 +1,11 @@ /** @file -Parser: apache 1.3 module, part, compiled by parser3project. +Parser: apache 1.3/2.X module, part, compiled by parser3project. - Copyright (c) 2001-2005 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 * const IDENT_MOD_PARSER3_MAIN_C="$Date: 2010/11/14 22:44:23 $"; +volatile const char * IDENT_MOD_PARSER3_CORE_C="$Id: mod_parser3_core.C,v 1.9 2013/07/24 21:37:44 moko Exp $"; #include "pa_config_includes.h" @@ -17,7 +17,6 @@ static const char * const IDENT_MOD_PARS #include "pa_sapi.h" #include "classes.h" #include "pa_request.h" -#include "pa_version.h" #include "pa_socks.h" #if _MSC_VER && !defined(_DEBUG) @@ -27,12 +26,9 @@ static const char * const IDENT_MOD_PARS // generals -const char* pa_version() { - return "Parser/"PARSER_VERSION; -} +static bool globals_inited=false; void pa_setup_module_cells() { - static bool globals_inited=false; if(globals_inited) return; globals_inited=true; @@ -50,6 +46,9 @@ void pa_setup_module_cells() { } void pa_destroy_module_cells() { + if(!globals_inited) + return; + pa_globals_done(); pa_socks_done(); @@ -193,8 +192,8 @@ size_t SAPI::send_body(SAPI_Info& SAPI_i //@} -#if !defined(PA_DEBUG_DISABLE_GC) && !defined(WIN32) -extern long GC_large_alloc_warn_suppressed; +#ifndef PA_DEBUG_DISABLE_GC +extern long GC_large_alloc_warn_suppressed; #endif /** @@ -204,14 +203,11 @@ main workhorse */ static void real_parser_handler(SAPI_Info& SAPI_info, Parser_module_config *dcfg) { // collect garbage from prev request -#if !defined(PA_DEBUG_DISABLE_GC) && !defined(WIN32) - { - int saved=GC_dont_gc; - GC_dont_gc=0; - GC_gcollect(); - GC_dont_gc=saved; - GC_large_alloc_warn_suppressed=0; - } +#ifndef PA_DEBUG_DISABLE_GC + GC_dont_gc=0; + GC_gcollect(); + GC_dont_gc=1; + GC_large_alloc_warn_suppressed=0; #endif // populate env @@ -236,8 +232,7 @@ static void real_parser_handler(SAPI_Inf Request request( SAPI_info, request_info, - String::Language(String::L_HTML|String::L_OPTIMIZE_BIT), - dcfg->parser_status_allowed?true:false + String::Language(String::L_HTML|String::L_OPTIMIZE_BIT) ); // process the request