--- parser3/src/targets/isapi/parser3isapi.C 2003/02/17 12:13:45 1.82.2.4 +++ parser3/src/targets/isapi/parser3isapi.C 2003/02/26 11:51:16 1.82.2.6 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_PARSER3ISAPI_C="$Date: 2003/02/17 12:13:45 $"; +static const char* IDENT_PARSER3ISAPI_C="$Date: 2003/02/26 11:51:16 $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] @@ -22,7 +22,6 @@ static const char* IDENT_PARSER3ISAPI_C= #include #include -#include #include @@ -84,16 +83,27 @@ void SAPI::log(Pool& pool, const char* f } /// @todo event log -void SAPI::die(const char* fmt, ...) { - if(FILE *log=fopen("c:\\die.log", "at")) { - va_list args; - va_start(args,fmt); +static void die_or_abort(const char* fmt, va_list args, bool write_core) { + if(FILE *log=fopen("c:\\parser3die.log", "at")) { vfprintf(log, fmt, args); fclose(log); } // exit & try to produce core dump abort(); } +void SAPI::die(const char* fmt, ...) { + va_list args; + va_start(args, fmt); + die_or_abort(fmt, args, false/*write core?*/); + va_end(args); +} + +void SAPI::abort(const char* fmt, ...) { + va_list args; + va_start(args, fmt); + die_or_abort(fmt, args, true/*write core?*/); + va_end(args); +} const char* SAPI::get_env(Pool& pool, const char* name) { SAPI_func_context& ctx=*static_cast(pool.get_context()); @@ -139,7 +149,7 @@ static const char* mk_env_pair(Pool& poo } const char* const *SAPI::environment(SAPI_Info& info, Pool& pool) { // we know this buf is writable - char *all_http_vars=const_cast(SAPI::get_env(pool, "ALL_HTTP")); + const char* all_http_vars=SAPI::get_env(pool, "ALL_HTTP"); const int http_var_count=grep_char(all_http_vars, '\n')+1/*\n for theoretical(never saw) this \0*/; const char* *result=new(pool) const char*[IIS51var_count+http_var_count+1/*0*/]; @@ -256,28 +266,13 @@ void SAPI::send_body(Pool& pool, const v const_cast(buf), &num_bytes, HSE_IO_SYNC); } -// -int failed_new(size_t size) { - SAPI::die("out of memory in 'new', failed to allocated %u bytes", size); - return 0; // not reached -} - -#ifdef _DEBUG -static Pool_storage *global_pool_storagep; -#endif static bool parser_init() { static bool globals_inited=false; if(globals_inited) return true; globals_inited=true; - _set_new_handler(failed_new); - - static Pool_storage pool_storage; -#ifdef _DEBUG - global_pool_storagep=&pool_storage; -#endif static Pool pool(&pool_storage); // global pool try { // init socks