--- parser3/src/targets/isapi/parser3isapi.C 2001/10/22 16:44:43 1.55 +++ parser3/src/targets/isapi/parser3isapi.C 2002/02/08 08:30:18 1.63 @@ -1,10 +1,10 @@ /** @file Parser: IIS extension. - Copyright (c) 2000,2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Copyright (c) 2000,2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) - $Id: parser3isapi.C,v 1.55 2001/10/22 16:44:43 parser Exp $ + $Id: parser3isapi.C,v 1.63 2002/02/08 08:30:18 paf Exp $ */ #ifndef _MSC_VER @@ -15,6 +15,7 @@ #include #include +#include #include @@ -109,7 +110,7 @@ void SAPI::log(Pool& pool, const char *f } /// @todo event log -void SAPI::die(Pool& pool, const char *fmt, ...) { +void SAPI::die(const char *fmt, ...) { exit(1); } @@ -186,10 +187,10 @@ void SAPI::add_header_attribute(Pool& po void SAPI::send_header(Pool& pool) { SAPI_func_context& ctx=*static_cast(pool.get_context()); - ctx.header->APPEND_CONST( +/* ctx.header->APPEND_CONST( "expires: Fri, 23 Mar 2001 09:32:23 GMT\r\n" "\r\n"); - HSE_SEND_HEADER_EX_INFO header_info; +*/ HSE_SEND_HEADER_EX_INFO header_info; char status_buf[MAX_STATUS_LENGTH]; switch(ctx.http_response_code) { @@ -229,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 @@ -334,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