--- parser3/src/targets/cgi/parser3.C 2001/12/05 11:24:55 1.144 +++ parser3/src/targets/cgi/parser3.C 2002/01/31 10:20:21 1.151 @@ -4,17 +4,16 @@ Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: parser3.C,v 1.144 2001/12/05 11:24:55 paf Exp $ + $Id: parser3.C,v 1.151 2002/01/31 10:20:21 paf Exp $ */ #include "pa_config_includes.h" -#ifdef WIN32 -# include -#endif - #if _MSC_VER # include +# include +#else +# include "pa_config_paths.h" #endif #include "pa_sapi.h" @@ -25,8 +24,8 @@ #include "pa_version.h" #include "pool_storage.h" -#ifdef XML -#include +#ifdef WIN32 +# include #endif //#define DEBUG_POOL_MALLOC @@ -41,9 +40,6 @@ extern const char *gd_RCSIds[]; extern const char *classes_RCSIds[]; extern const char *types_RCSIds[]; extern const char *parser3_RCSIds[]; -#ifdef XML -extern const char *xalan_patched_RCSIds[]; -#endif const char **RCSIds[]={ main_RCSIds, #ifdef USE_SMTP @@ -53,9 +49,6 @@ const char **RCSIds[]={ classes_RCSIds, types_RCSIds, parser3_RCSIds, -#ifdef XML - xalan_patched_RCSIds, -#endif 0 }; @@ -177,7 +170,7 @@ void SAPI::add_header_attribute(Pool& , /// @todo intelligent cache-control void SAPI::send_header(Pool& ) { if(cgi) { - puts("expires: Fri, 23 Mar 2001 09:32:23 GMT"); +// puts("expires: Fri, 23 Mar 2001 09:32:23 GMT"); // header | body delimiter puts(""); @@ -215,17 +208,6 @@ void real_parser_handler( // init socks init_socks(pool); -#ifdef XML - /** - * Initialize Xerces and Xalan. - * - * Should be called only once per process before making - * any other API calls. - */ - //_asm int 3; - XalanInitialize(); -#endif - // init global classes init_methoded_array(pool); // init global variables @@ -279,8 +261,9 @@ void real_parser_handler( throw Exception(0, 0, 0, "CGI: no PATH_INFO defined(in reinventing REQUEST_URI)"); - /* - they've changed this under IIS5. + +#ifndef WIN32 + // they've changed this under IIS5. if(const char *script_name=SAPI::get_env(pool, "SCRIPT_NAME")) { size_t script_name_len=strlen(script_name); size_t uri_len=strlen(request_info.uri); @@ -288,7 +271,7 @@ void real_parser_handler( script_name_len != uri_len) // under IIS they are the same SAPI::die("CGI: illegal call"); } - */ +#endif } else request_info.uri=0; @@ -310,8 +293,8 @@ void real_parser_handler( true /* status_allowed */); // some root-controlled location -#ifdef SYSCONFDIR - const char *root_config_filespec=SYSCONFDIR "/" CONFIG_FILE_NAME; +#ifdef PARSER_ROOT_CONFIG_DIR + const char *root_config_filespec=PARSER_ROOT_CONFIG_DIR "/" CONFIG_FILE_NAME; #else # ifdef WIN32 // c:\windows @@ -407,7 +390,7 @@ int main(int argc, char *argv[]) { umask(2); // were we started as CGI? - cgi=1|| + cgi= getenv("SERVER_SOFTWARE") || getenv("SERVER_NAME") || getenv("GATEWAY_INTERFACE") || @@ -434,6 +417,20 @@ int main(int argc, char *argv[]) { #if _MSC_VER _set_new_handler(failed_new); + +#ifdef _DEBUG + // Get current flag + int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); + + // Turn on leak-checking bit + tmpFlag |= _CRTDBG_LEAK_CHECK_DF; + + // Set flag to the new value + _CrtSetDbgFlag( tmpFlag ); +// _CrtSetBreakAlloc(471); + +#endif + #endif #ifdef HAVE_SET_NEW_HANDLER