--- parser3/src/main/pa_request.C 2001/11/08 11:04:13 1.178 +++ parser3/src/main/pa_request.C 2001/11/16 12:38:44 1.181 @@ -4,13 +4,11 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_request.C,v 1.178 2001/11/08 11:04:13 paf Exp $ + $Id: pa_request.C,v 1.181 2001/11/16 12:38:44 paf Exp $ */ #include "pa_config_includes.h" -//#include "pcre.h" -//#include "internal.h" extern "C" unsigned char pcre_default_tables[]; // pcre/chartables.c #include "pa_sapi.h" @@ -52,7 +50,8 @@ static void load_charset(const Hash::Key // Request::Request(Pool& apool, Info& ainfo, - String::Untaint_lang adefault_lang) : Pooled(apool), + String::Untaint_lang adefault_lang, + bool status_allowed) : Pooled(apool), stack(apool), OP(*MOP_create(apool)), env(apool), @@ -90,7 +89,8 @@ Request::Request(Pool& apool, // env class classes().put(*NEW String(pool(), ENV_CLASS_NAME), &env); // status class - classes().put(*NEW String(pool(), STATUS_CLASS_NAME), &status); + if(status_allowed) + classes().put(*NEW String(pool(), STATUS_CLASS_NAME), &status); // request class classes().put(*NEW String(pool(), REQUEST_CLASS_NAME), &request); // cookie class @@ -114,6 +114,9 @@ Request::Request(Pool& apool, the file user requested us to process all located classes become children of one another, composing class we name 'MAIN' + + @test log stack trace + */ void Request::core( const char *root_config_filespec, bool root_config_fail_on_read_problem, @@ -214,10 +217,6 @@ void Request::core( if(Value *vcharset=(Value *)hash->get(*charset_name)) pool().set_charset(vcharset->as_string()); - if(Value *element=main_class->get_element(*user_html_name)) - if(Table *table=element->get_table()) - pool().set_tag(NEW Dictionary(*table)); - // $MAIN:MIME-TYPES if(Value *element=main_class->get_element(*mime_types_name)) if(Table *table=element->get_table()) @@ -279,7 +278,7 @@ void Request::core( if(problem_source && problem_source->size()) SAPI::log(pool(), #ifndef NO_STRING_ORIGIN - "%s(%d): " + ORIGIN_FILE_LINE_FORMAT": " #endif "'%s' %s [%s %s]", #ifndef NO_STRING_ORIGIN @@ -297,14 +296,10 @@ void Request::core( e.comment(), e.type()?e.type()->cstr():"-", e.code()?e.code()->cstr():"-" - ); - - /// @test log stack trace + ); // reset language to default flang=fdefault_lang; - if(flang==String::UL_USER_HTML) - flang=String::UL_HTML; // no _ & Co conversions in @exception[params] // reset response response.fields().clear(); @@ -331,7 +326,7 @@ void Request::core( const Origin& origin=problem_source->origin(); if(origin.file) { char *buf=(char *)malloc(MAX_STRING); - size_t buf_size=snprintf(buf, MAX_STRING, "%s(%d)", + size_t buf_size=snprintf(buf, MAX_STRING, ORIGIN_FILE_LINE_FORMAT, origin.file, 1+origin.line); origin_value=NEW VString(*NEW String(pool(), buf, buf_size, true)); @@ -393,7 +388,7 @@ void Request::core( const Origin& origin=name->origin(); if(origin.file) { char *buf=(char *)malloc(MAX_STRING); - size_t buf_size=snprintf(buf, MAX_STRING, "%s(%d)", + size_t buf_size=snprintf(buf, MAX_STRING, ORIGIN_FILE_LINE_FORMAT, origin.file, 1+origin.line); row+=NEW String(pool(), buf, buf_size, true); // origin column } @@ -420,8 +415,10 @@ void Request::core( #ifndef NO_STRING_ORIGIN const Origin& origin=problem_source->origin(); if(origin.file) - printed+=snprintf(buf+printed, MAX_STRING-printed, "%s(%d): ", - origin.file, 1+origin.line); + printed+=snprintf(buf+printed, MAX_STRING-printed, + ORIGIN_FILE_LINE_FORMAT": ", + origin.file, 1+origin.line + ); #endif printed+=snprintf(buf+printed, MAX_STRING-printed, "'%s' ", problem_source->cstr());