--- parser3/src/main/pa_request.C 2005/11/21 11:23:07 1.274.6.3 +++ parser3/src/main/pa_request.C 2006/04/09 12:25:04 1.280.8.1 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_REQUEST_C="$Date: 2005/11/21 11:23:07 $"; +static const char * const IDENT_REQUEST_C="$Date: 2006/04/09 12:25:04 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -107,7 +107,7 @@ Request::Request(SAPI_Info& asapi_info, wcontext(0), flang(adefault_lang), fconnection(0), - finterrupted(false), + finterrupted(false),fbreak(0), // public #ifdef RESOURCES_DEBUG @@ -220,7 +220,7 @@ void Request::configure_admin(VStateless if(Value* vcharsets=conf_class.get_element(charsets_name, conf_class, false)) { if(!vcharsets->is_string()) if(HashStringValue* charsets=vcharsets->get_hash()) - charsets->for_each(load_charset, &this->charsets); + charsets->for_each(load_charset, &this->charsets); else throw Exception("parser.runtime", 0, @@ -495,6 +495,7 @@ frame.store_param(*new VTable(&stack_tra // future $response:body= // execute ^unhandled_exception[exception;stack] +exception_trace.clear(); // forget all about previous life, in case there would be error inside of this method, error handled would not be mislead by old stack contents (see extract_origin) body_string=&execute_method(frame, *method).as_string(); } } @@ -559,12 +560,12 @@ void Request::use_file(VStateless_class& file_spec=0; if(Value* element=main_class.get_element(class_path_name, main_class, false)) { if(element->is_string()) { - file_spec=file_readable(absolute(element->as_string()), file_name); // found at class_path? + file_spec=file_exist(absolute(element->as_string()), file_name); // found at class_path? } else if(Table *table=element->get_table()) { int size=table->count(); for(int i=size; i--; ) { const String& path=*(*table->get(i))[0]; - if((file_spec=file_readable(absolute(path), file_name))) + if((file_spec=file_exist(absolute(path), file_name))) break; // found along class_path } } else @@ -861,7 +862,7 @@ void Request::output_result(VFile* body_ // prepare header: $response:fields without :body Add_header_attribute_info info(*this); - response.fields().for_each(add_header_attribute, &info); + response.fields().for_each(add_header_attribute, &info); if(body_file_content_type) if(HashStringValue *hash=body_file_content_type->get_hash()) @@ -914,19 +915,15 @@ const String& Request::mime_type_of(cons } #ifdef XML -GdomeDOMString_auto_ptr Request::transcode(const String& s) { +xmlChar* Request::transcode(const String& s) { return charsets.source().transcode(s); } -GdomeDOMString_auto_ptr Request::transcode(const String::Body s) { +xmlChar* Request::transcode(const String::Body s) { return charsets.source().transcode(s); } -const String& Request::transcode(GdomeDOMString* s) { - return charsets.source().transcode(s); -} - -const String& Request::transcode(xmlChar* s) { +const String& Request::transcode(const xmlChar* s) { return charsets.source().transcode(s); } #endif @@ -937,13 +934,15 @@ const Request::Trace Request::Exception_ if(!is_empty()) { result=bottom_value(); if(!problem_source) { // we don't know who trigged the bug? - problem_source=result.name(); // consider the stack-top-guy did that + problem_source=result.name(); // consider the stack-top-guy (we usually know source of next-from-throw-point exception) did that fbottom++; } else if(result.name()==problem_source) // it is that same guy? fbottom++; // throw away that trace - // else stack top contains not us, - // leaving result intact - // it would help ^throw + else { + // stack top contains not us, + // leaving result intact + // it would help ^throw + } } return result;