--- parser3/src/targets/isapi/parser3isapi.C 2004/02/11 15:33:17 1.87 +++ parser3/src/targets/isapi/parser3isapi.C 2004/04/01 11:43:54 1.89 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_PARSER3ISAPI_C="$Date: 2004/02/11 15:33:17 $"; +static const char * const IDENT_PARSER3ISAPI_C="$Date: 2004/04/01 11:43:54 $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] @@ -258,7 +258,7 @@ static bool parser_init() { try { // init socks - pa_init_socks(); + pa_socks_init(); // init global variables pa_globals_init(); @@ -272,6 +272,14 @@ static bool parser_init() { } } +static void parser_done() { + // finalize global variables + pa_globals_done(); + + // + pa_socks_done(); +} + /// ISAPI // BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) { pVer->dwExtensionVersion = HSE_VERSION; @@ -279,6 +287,15 @@ BOOL WINAPI GetExtensionVersion(HSE_VERS pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1]=0; return parser_init(); } +// dwFlags & HSE_TERM_MUST_UNLOAD means we can't return false +BOOL WINAPI TerminateExtension( + DWORD /*dwFlags*/ +) +{ + parser_done(); + + return TRUE; +} /** ISAPI // main workhorse @@ -293,6 +310,16 @@ BOOL WINAPI GetExtensionVersion(HSE_VERS */ 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; + } +#endif + SAPI_info.header=new String; LPEXTENSION_CONTROL_BLOCK lpECB=SAPI_info.lpECB;