--- parser3/src/targets/apache/mod_parser3_core.C 2010/11/13 00:43:22 1.1 +++ parser3/src/targets/apache/mod_parser3_core.C 2013/07/24 21:21:43 1.8 @@ -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/13 00:43:22 $"; +volatile const char * IDENT_MOD_PARSER3_CORE_C="$Id: mod_parser3_core.C,v 1.8 2013/07/24 21:21:43 moko Exp $"; #include "pa_config_includes.h" @@ -17,22 +17,17 @@ 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) -# include # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif // 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 +45,9 @@ void pa_setup_module_cells() { } void pa_destroy_module_cells() { + if(!globals_inited) + return; + pa_globals_done(); pa_socks_done(); @@ -193,8 +191,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 +202,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 @@ -232,13 +227,11 @@ static void real_parser_handler(SAPI_Inf request_info.cookie=SAPI::get_env(SAPI_info, "HTTP_COOKIE"); request_info.mail_received=false; - //_asm int 3; // prepare to process request 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 @@ -296,20 +289,12 @@ static void call_real_parser_handler__su /// @test r->finfo.st_mode check seems to work only on win32 int pa_parser_handler(pa_request_rec *r, Parser_module_config *dcfg) { - //_asm int 3; - // SAPI info SAPI_Info SAPI_info; SAPI_info.r=r; - //_asm int 3; - if(r->finfo->st_mode == 0) + if(r->file_not_found ) return PA_HTTP_NOT_FOUND; - /* A flag which modules can set, to indicate that the data being - * returned is volatile, and clients should be told not to cache it. - */ - // r->no_cache=1; - try { // global try #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION call_real_parser_handler__supress_system_exception(