--- parser3/src/main/pa_request.C 2002/10/14 15:22:42 1.233 +++ parser3/src/main/pa_request.C 2002/10/16 08:22:14 1.236 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_REQUEST_C="$Date: 2002/10/14 15:22:42 $"; +static const char* IDENT_REQUEST_C="$Date: 2002/10/16 08:22:14 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -68,7 +68,7 @@ Request::Request(Pool& apool, #ifdef RESOURCES_DEBUG , sql_connect_time(0),sql_request_time(0) #endif - , self(0), method_frame(0), rcontext(0), wcontext(0) + , method_frame(0), rcontext(0), wcontext(0) { // default charsets pool().set_source_charset(*utf8_charset); @@ -79,7 +79,7 @@ Request::Request(Pool& apool, /// directly used // MAIN class, operators - classes().put(*NEW String(pool(), MAIN_CLASS_NAME), &main_class); + classes().put(main_class.name(), &main_class); // classes: // table, file, random, mail, image, ... methoded_array->register_directly_used(*this); @@ -118,6 +118,8 @@ Request::~Request() { #endif } +Value *Request::get_self() { return method_frame?&method_frame->self():0; } + static void load_charset(const Hash::Key& akey, Hash::Val *avalue, void *) { charsets->load_charset(akey, static_cast(avalue)->as_string()); } @@ -267,7 +269,7 @@ gettimeofday(&mt[2],NULL); if(const Method *method=junction->method) { // preparing to pass parameters to // @postprocess[data] - VMethodFrame frame(pool(), method->name, *junction); + VMethodFrame frame(pool(), method->name, *junction, 0/*no parent*/); frame.set_self(main_class); frame.store_param(&body_vstring_before_post_process); @@ -362,7 +364,7 @@ t[9]-t[3] if(const Method *method=junction->method) { // preparing to pass parameters to // @unhandled_exception[exception;stack] - VMethodFrame frame(pool(), method->name, *junction); + VMethodFrame frame(pool(), method->name, *junction, 0/*no caller*/); frame.set_self(main_class); // $exception