--- parser3/src/targets/apache13/Attic/mod_parser3.C 2001/11/08 11:52:34 1.9 +++ parser3/src/targets/apache13/Attic/mod_parser3.C 2001/12/13 10:37:03 1.14 @@ -4,7 +4,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: mod_parser3.C,v 1.9 2001/11/08 11:52:34 paf Exp $ + $Id: mod_parser3.C,v 1.14 2001/12/13 10:37:03 paf Exp $ */ #include "httpd.h" @@ -15,6 +15,12 @@ #include "http_protocol.h" #include "util_script.h" +#include "pa_config_includes.h" + +#if _MSC_VER +# include +#endif + #include "pa_sapi.h" #include "classes.h" #include "pa_common.h" @@ -263,7 +269,7 @@ static void real_parser_handler(Pool& po // prepare to process request Request request(pool, request_info, - String::UL_USER_HTML, + String::UL_HTML|String::UL_OPTIMIZE_BIT, dcfg->parser_status_allowed ); @@ -322,7 +328,7 @@ static int parser_handler(request_rec *r /* A flag which modules can set, to indicate that the data being * returned is volatile, and clients should be told not to cache it. */ - r->no_cache=1; +// r->no_cache=1; try { // global try call_real_parser_handler__do_SEH(pool, r); @@ -361,6 +367,19 @@ static int parser_handler(request_rec *r return OK; } +#if _MSC_VER +int failed_new(size_t size) { + SAPI::die("out of memory in 'new', failed to allocated %u bytes", size); + return 0; // not reached +} +#endif + +#ifdef HAVE_SET_NEW_HANDLER +void failed_new() { + SAPI::die("out of memory in 'new'"); +} +#endif + /*--------------------------------------------------------------------------*/ /* */ /* Now let's declare routines for each of the callback phase in order. */ @@ -404,6 +423,14 @@ static void setup_module_cells() { return; globals_inited=true; +#ifdef WIN32 + _set_new_handler(failed_new); +#endif + +#ifdef HAVE_SET_NEW_HANDLER + std::set_new_handler(failed_new); +#endif + /* * allocate our module-private pool. */ @@ -457,6 +484,7 @@ static void parser_server_init(server_re * structure. */ static void *parser_create_dir_config(pool *p, char *dirspec) { + //_asm int 3; /* * Allocate the space for our record from the pool supplied. */ @@ -466,9 +494,6 @@ static void *parser_create_dir_config(po * Now fill in the defaults. If there are any `parent' configuration * records, they'll get merged as part of a separate callback. */ - cfg->parser_root_config_filespec = 0; - cfg->parser_site_config_filespec = 0; - cfg->parser_status_allowed=false; return (void *) cfg; } @@ -487,25 +512,31 @@ static void *parser_create_dir_config(po * * The return value is a pointer to the created module-specific structure * containing the merged values. + + 20011126 paf: noticed, that this is called even on virtual root merge with something "parent", + while thought that that is part of merge_server... + */ static void *parser_merge_dir_config(pool *p, void *parent_conf, void *newloc_conf) { + //_asm int 3; Parser_module_config *merged_config = (Parser_module_config *) ap_pcalloc(p, sizeof(Parser_module_config)); Parser_module_config *pconf = (Parser_module_config *) parent_conf; Parser_module_config *nconf = (Parser_module_config *) newloc_conf; - // always from parent - merged_config->parser_root_config_filespec = ap_pstrdup(p, pconf->parser_root_config_filespec); + merged_config->parser_root_config_filespec = ap_pstrdup(p, nconf->parser_root_config_filespec? + nconf->parser_root_config_filespec:pconf->parser_root_config_filespec); + merged_config->parser_site_config_filespec = ap_pstrdup(p, nconf->parser_site_config_filespec? + nconf->parser_site_config_filespec:pconf->parser_site_config_filespec); merged_config->parser_status_allowed= pconf->parser_status_allowed || nconf->parser_status_allowed; - /* + + /* * Some things get copied directly from the more-specific record, rather * than getting merged. */ - merged_config->parser_site_config_filespec = ap_pstrdup(p, nconf->parser_site_config_filespec? - nconf->parser_site_config_filespec:pconf->parser_site_config_filespec); return (void *) merged_config; } @@ -518,17 +549,14 @@ static void *parser_merge_dir_config(poo * structure. */ static void *parser_create_server_config(pool *p, server_rec *s) { + //_asm int 3; /* - * As with the parser_create_dir_config() reoutine, we allocate and fill + * As with the parser_create_dir_config() routine, we allocate and fill * in an empty record. */ Parser_module_config *cfg= (Parser_module_config *) ap_pcalloc(p, sizeof(Parser_module_config)); - cfg->parser_root_config_filespec = 0; - cfg->parser_site_config_filespec = 0; - cfg->parser_status_allowed=false; - return (void *) cfg; } @@ -548,6 +576,7 @@ static void *parser_create_server_config static void *parser_merge_server_config(pool *p, void *server1_conf, void *server2_conf) { + //_asm int 3; Parser_module_config *merged_config = (Parser_module_config *) ap_pcalloc(p, sizeof(Parser_module_config));