--- parser3/src/targets/isapi/parser3isapi.C 2017/02/07 22:00:45 1.109 +++ parser3/src/targets/isapi/parser3isapi.C 2020/08/13 10:53:15 1.113 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -volatile const char * IDENT_PARSER3ISAPI_C="$Id: parser3isapi.C,v 1.109 2017/02/07 22:00:45 moko Exp $"; +volatile const char * IDENT_PARSER3ISAPI_C="$Id: parser3isapi.C,v 1.113 2020/08/13 10:53:15 moko Exp $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] @@ -17,7 +17,6 @@ volatile const char * IDENT_PARSER3ISAPI #include "pa_globals.h" #include "pa_request.h" #include "pa_version.h" -#include "pa_socks.h" #include #include @@ -26,7 +25,7 @@ volatile const char * IDENT_PARSER3ISAPI // defines -#if _MSC_VER && !defined(_DEBUG) +#if defined(_MSC_VER) && !defined(_DEBUG) # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif @@ -267,27 +266,19 @@ static bool parser_init() { globals_inited=true; try { - // init socks - pa_socks_init(); - // init global variables + // init libraries pa_globals_init(); - // successful finish return true; } catch(.../*const Exception& e*/) { // global problem - //const char* body=e.comment(); - // unsuccessful finish return false; } } static void parser_done() { - // finalize global variables + // finalize libraries pa_globals_done(); - - // - pa_socks_done(); } /// ISAPI // @@ -321,12 +312,9 @@ BOOL WINAPI TerminateExtension( void real_parser_handler(SAPI_Info& SAPI_info, bool header_only) { // collect garbage from prev request #ifndef PA_DEBUG_DISABLE_GC - { - int saved=GC_dont_gc; - GC_dont_gc=0; - GC_gcollect(); - GC_dont_gc=saved; - } + GC_dont_gc=0; + GC_gcollect(); + GC_dont_gc=1; #endif SAPI_info.header=new String; @@ -398,10 +386,7 @@ void real_parser_handler(SAPI_Info& SAPI } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION -static const Exception -call_real_parser_handler__do_PEH_return_it( - SAPI_Info& SAPI_info, bool header_only) -{ +static const Exception call_real_parser_handler__do_PEH_return_it(SAPI_Info& SAPI_info, bool header_only) { try { real_parser_handler(SAPI_info, header_only); } catch(const Exception& e) { @@ -410,33 +395,21 @@ call_real_parser_handler__do_PEH_return_ return Exception(); } -static void call_real_parser_handler__supress_system_exception( - SAPI_Info& SAPI_info, bool header_only) -{ + +static void call_real_parser_handler__supress_system_exception(SAPI_Info& SAPI_info, bool header_only) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { - parser_exception=call_real_parser_handler__do_PEH_return_it( - SAPI_info, header_only); - } __except ( - (system_exception=GetExceptionInformation()), - EXCEPTION_EXECUTE_HANDLER) - { - + parser_exception=call_real_parser_handler__do_PEH_return_it(SAPI_info, header_only); + } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) - throw Exception("system", - 0, - "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); + throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else - throw Exception("system", - 0, - ""); + throw Exception("system", 0, ""); else - throw Exception("system", - 0, - ""); + throw Exception("system", 0, ""); } if(parser_exception)