--- parser3/src/main/pa_request.C 2002/03/27 15:30:36 1.197 +++ parser3/src/main/pa_request.C 2002/04/18 10:51:01 1.201 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: pa_request.C,v 1.197 2002/03/27 15:30:36 paf Exp $ + $Id: pa_request.C,v 1.201 2002/04/18 10:51:01 paf Exp $ */ #include "pa_sapi.h" @@ -65,8 +65,9 @@ Request::Request(Pool& apool, anti_endless_execute_recoursion(0), exception_trace(apool) #ifdef RESOURCES_DEBUG - ,sql_connect_time(0),sql_request_time(0) + , sql_connect_time(0),sql_request_time(0) #endif + , self(0), root(0), rcontext(0), wcontext(0) { // default charsets pool().set_source_charset(*utf8_charset); @@ -162,8 +163,8 @@ gettimeofday(&mt[0],NULL); charsets->for_each(load_charset); else throw Exception("parser.runtime", - &vcharsets->name(), - "must be hash"); + 0, + "$" CHARSETS_NAME " must be hash"); } } // configure root options @@ -256,7 +257,7 @@ gettimeofday(&mt[2],NULL); if(const Method *method=junction->method) { // preparing to pass parameters to // @postprocess[data] - VMethodFrame frame(pool(), value->name(), *junction); + VMethodFrame frame(pool(), method->name, *junction); frame.set_self(*main_class); frame.store_param(method->name, @@ -312,10 +313,12 @@ t[9]-t[3] const String *problem_source=e.problem_source(); if(problem_source && problem_source->size()) SAPI::log(pool(), + "%s: " #ifndef NO_STRING_ORIGIN ORIGIN_FILE_LINE_FORMAT": " #endif "'%s' %s [%s]", + info.uri, #ifndef NO_STRING_ORIGIN problem_source->origin().file?problem_source->origin().file:"global", problem_source->origin().line, @@ -326,7 +329,9 @@ t[9]-t[3] ); else SAPI::log(pool(), + "%s: " "%s [%s]", + info.uri, e.comment(), e.type()?e.type():"-" ); @@ -348,7 +353,7 @@ t[9]-t[3] if(const Method *method=junction->method) { // preparing to pass parameters to // @unhandled_exception[exception;stack] - VMethodFrame frame(pool(), value->name(), *junction); + VMethodFrame frame(pool(), method->name, *junction); frame.set_self(*main_class); // $exception @@ -456,8 +461,8 @@ VStateless_class *Request::use_file(cons } } else throw Exception("parser.runtime", - &element->name(), - "must be string or table"); + 0, + "$" CLASS_PATH_NAME " must be string or table"); if(!file_spec) throw Exception("parser.runtime", &file_name, @@ -558,11 +563,9 @@ void Request::output_result(const VFile& ); // prepare header: content-length - if(client_content_length) { // useful for redirecting [header "location: http://..."] - char content_length_cstr[MAX_NUMBER]; - snprintf(content_length_cstr, MAX_NUMBER, "%u", client_content_length); - SAPI::add_header_attribute(pool(), "content-length", content_length_cstr); - } + char content_length_cstr[MAX_NUMBER]; + snprintf(content_length_cstr, MAX_NUMBER, "%u", client_content_length); + SAPI::add_header_attribute(pool(), "content-length", content_length_cstr); // send header SAPI::send_header(pool());