--- parser3/src/targets/cgi/parser3.C 2004/02/11 11:31:39 1.223 +++ parser3/src/targets/cgi/parser3.C 2004/04/02 13:48:09 1.226 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_PARSER3_C="$Date: 2004/02/11 11:31:39 $"; +static const char * const IDENT_PARSER3_C="$Date: 2004/04/02 13:48:09 $"; #include "pa_config_includes.h" @@ -33,6 +33,7 @@ static const char * const IDENT_PARSER3_ #define REDIRECT_PREFIX "REDIRECT_" #define PARSER_CONFIG_ENV_NAME "CGI_PARSER_CONFIG" +#define PARSER_LOG_ENV_NAME "CGI_PARSER_LOG" /// IIS refuses to read bigger chunks const size_t READ_POST_CHUNK_SIZE=0x400*0x400; // 1M @@ -57,7 +58,15 @@ static void log(const char* fmt, va_list bool opened=false; FILE *f=0; - if(config_filespec_cstr) { + const char* log_by_env=getenv(PARSER_LOG_ENV_NAME); + if(!log_by_env) + log_by_env=getenv(REDIRECT_PREFIX PARSER_LOG_ENV_NAME); + if(log_by_env) { + f=fopen(log_by_env, "at"); + opened=f!=0; + } + + if(!opened && config_filespec_cstr) { char beside_config_path[MAX_STRING]; strncpy(beside_config_path, config_filespec_cstr, MAX_STRING-1); beside_config_path[MAX_STRING-1]=0; if(!( @@ -276,7 +285,7 @@ main workhorse static void real_parser_handler(const char* filespec_to_process, const char* request_method, bool header_only) { // init socks - pa_init_socks(); + pa_socks_init(); // init global variables pa_globals_init(); @@ -423,8 +432,11 @@ static void real_parser_handler(const ch // no request [prevent signal handlers from accessing invalid memory] ::request=0; + // finalize global variables + pa_globals_done(); + // - pa_done_socks(); + pa_socks_done(); } #if _MSC_VER && !defined(_DEBUG) @@ -507,6 +519,7 @@ static void usage(const char* program) { } int main(int argc, char *argv[]) { + //_asm int 3; GC_java_finalization=0; #ifndef PA_DEBUG_DISABLE_GC