--- parser3/src/targets/cgi/parser3.C 2003/03/17 14:48:06 1.216.4.1 +++ parser3/src/targets/cgi/parser3.C 2003/03/21 07:08:28 1.217 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_PARSER3_C="$Date: 2003/03/17 14:48:06 $"; +static const char* IDENT_PARSER3_C="$Date: 2003/03/21 07:08:28 $"; #include "pa_config_includes.h" @@ -21,6 +21,8 @@ static const char* IDENT_PARSER3_C="$Dat #include "pa_socks.h" #include "pa_version.h" +#include "pool_storage.h" + #ifdef WIN32 # include # include "getopt.h" @@ -52,7 +54,8 @@ static const char *argv0; static const char *config_filespec_cstr=0; static bool fail_on_config_read_problem=true; -static Pool global_pool(0); ///< global pool +static Pool_storage global_pool_storage; ///< global pool storage +static Pool global_pool(&global_pool_storage); ///< global pool static bool cgi; ///< we were started as CGI? static bool mail_received=false; ///< we were started with -m option? [asked to parse incoming message to $mail:received] @@ -273,7 +276,7 @@ static void real_parser_handler( pa_globals_init(global_pool); // request pool, must be different ptr from global [used in VStateless_class.add_method] - Pool request_pool(0); + Pool request_pool(&global_pool_storage); if(!filespec_to_process || !*filespec_to_process) SAPI::die("Parser/%s", PARSER_VERSION); @@ -315,7 +318,7 @@ static void real_parser_handler( request_info.uri=env_request_uri; else if(query_string) { - char *reconstructed_uri=(char *)request_pool.malloc_atomic( + char *reconstructed_uri=(char *)request_pool.malloc( strlen(path_info)+1/*'?'*/+ strlen(query_string)+1/*0*/); strcpy(reconstructed_uri, path_info); @@ -441,7 +444,7 @@ static void real_parser_handler( static void call_real_parser_handler__do_SEH( const char *filespec_to_process, const char *request_method, bool header_only) { -#if _MSC_VER && !defined(_DEBUG) && 0 +#if _MSC_VER && !defined(_DEBUG) LPEXCEPTION_POINTERS system_exception=0; __try { #endif @@ -449,7 +452,7 @@ static void call_real_parser_handler__do filespec_to_process, request_method, header_only); -#if _MSC_VER && !defined(_DEBUG) && 0 +#if _MSC_VER && !defined(_DEBUG) } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { @@ -497,7 +500,18 @@ static void usage(const char *program) { exit(EINVAL); } + +class C { +public: + C() {} +}; +C *trick() { + return new C; +} + int main(int argc, char *argv[]) { + delete trick(); + #ifdef SIGUSR1 if(signal(SIGUSR1, SIGUSR1_handler)==SIG_ERR) SAPI::die("Can not set handler for SIGUSR1"); @@ -587,7 +601,7 @@ int main(int argc, char *argv[]) { // Set flag to the new value _CrtSetDbgFlag( tmpFlag ); - //_CrtSetBreakAlloc(60); +// _CrtSetBreakAlloc(471); #endif @@ -613,7 +627,7 @@ int main(int argc, char *argv[]) { // and there could be out-of-memory exception SAPI::die("exception in request exception handler: %s", e.comment()); -#if !defined(_DEBUG) && 0 +#ifndef _DEBUG } catch(...) { SAPI::die(""); #endif