--- parser3/src/targets/isapi/parser3isapi.C 2001/10/19 12:43:30 1.53 +++ parser3/src/targets/isapi/parser3isapi.C 2001/11/19 12:17:07 1.60 @@ -2,9 +2,9 @@ Parser: IIS extension. Copyright (c) 2000,2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: parser3isapi.C,v 1.53 2001/10/19 12:43:30 parser Exp $ + $Id: parser3isapi.C,v 1.60 2001/11/19 12:17:07 paf Exp $ */ #ifndef _MSC_VER @@ -15,6 +15,7 @@ #include #include +#include #include @@ -108,6 +109,11 @@ void SAPI::log(Pool& pool, const char *f HSE_APPEND_LOG_PARAMETER, buf, &size, 0); } +/// @todo event log +void SAPI::die(const char *fmt, ...) { + exit(1); +} + const char *SAPI::get_env(Pool& pool, const char *name) { SAPI_func_context& ctx=*static_cast(pool.get_context()); @@ -224,12 +230,19 @@ void SAPI::send_body(Pool& pool, const v // +int failed_new(size_t size) { + SAPI::die("out of memory in 'new', failed to allocated %u bytes", size); + return 0; // not reached +} + static bool parser_init() { static bool globals_inited=false; if(globals_inited) return true; globals_inited=true; + _set_new_handler(failed_new); + static Pool pool(0); // global pool try { // init socks @@ -329,8 +342,8 @@ void real_parser_handler(Pool& pool, LPE // prepare to process request Request request(pool, request_info, - String::UL_USER_HTML - ); + String::UL_HTML|String::UL_OPTIMIZE_BIT, + false /* status_allowed */); // some root-controlled location // c:\windows @@ -353,13 +366,13 @@ void real_parser_handler(Pool& pool, LPE void call_real_parser_handler__do_SEH(Pool& pool, LPEXTENSION_CONTROL_BLOCK lpECB, bool header_only) { -#ifdef WIN32 +#if _MSC_VER & !defined(_DEBUG) LPEXCEPTION_POINTERS system_exception=0; __try { #endif real_parser_handler(pool, lpECB, header_only); -#if _MSC_VER +#if _MSC_VER & !defined(_DEBUG) } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) {