--- parser3/src/classes/op.C 2002/04/29 06:27:29 1.94 +++ parser3/src/classes/op.C 2002/06/20 14:50:22 1.97 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: op.C,v 1.94 2002/04/29 06:27:29 paf Exp $ + $Id: op.C,v 1.97 2002/06/20 14:50:22 paf Exp $ */ #include "classes.h" @@ -100,6 +100,7 @@ static void _taint(Request& r, const Str } static void _process(Request& r, const String& method_name, MethodParams *params) { + Pool& pool=r.pool(); // calculate pseudo file name of processed chars // would be something like "/some/file(4) process" char local_place[MAX_STRING]; @@ -122,7 +123,7 @@ static void _process(Request& r, const S // temporary remove language change Temp_lang temp_lang(r, String::UL_PASS_APPENDED); // temporary zero @main so to maybe-replace it in processed code - Temp_method temp_method_main(self_class, *main_method_name, 0); + Temp_method temp_method_main(self_class, r.main_method_name, 0); // temporary zero @auto so it wouldn't be auto-called in Request::use_buf Temp_method temp_method_auto(self_class, *auto_method_name, 0); @@ -133,11 +134,12 @@ static void _process(Request& r, const S // maybe-define new @main r.use_buf( source.cstr(String::UL_UNSPECIFIED, r.connection(0)), + *new(pool) String(pool, heap_place, place_size, true /*tainted*/), heap_place, &self_class); // main_method - main_method=self_class.get_method(*main_method_name); + main_method=self_class.get_method(r.main_method_name); } // after restoring current-request-lang // maybe-execute @main[] @@ -400,7 +402,8 @@ const String *locked_process_and_cache_p "cache_put", locked_process_and_cache_put_action, &info, false/*as_text*/, false/*do_append*/, - false/*block*/) ? info.evaluated_body: 0; + false/*block*/, + false/*fail on lock problem*/) ? info.evaluated_body: 0; if(data.expires==0) cache_delete(file_spec); return result; @@ -629,7 +632,7 @@ static void _throw_operator(Request& r, const char *type=params->as_string(0, "type must be string").cstr(); const String& source=params->as_string(1, "source must be string"); const char *comment=params->size()>2?params->as_string(2, "comment must be string").cstr():0; - throw Exception(type, &source, "%s", comment); + throw Exception(type, &source, "%s", comment?comment:""); } }