--- parser3/src/main/pa_request.C 2001/04/20 14:18:43 1.117 +++ parser3/src/main/pa_request.C 2001/04/26 11:37:40 1.121 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_request.C,v 1.117 2001/04/20 14:18:43 paf Exp $ + $Id: pa_request.C,v 1.121 2001/04/26 11:37:40 paf Exp $ */ #include "pa_config_includes.h" @@ -109,7 +109,7 @@ static void element2ctypes(unsigned char ctypes_table[c]|=bit; if(group_offset>=0) - tables[cbits_offset+group_offset+c/8] |= 1 << (c&7); + tables[cbits_offset+group_offset+c/8] |= 1 << (c%8); } } static void cstr2ctypes(unsigned char *tables, const unsigned char *cstr, @@ -160,6 +160,7 @@ static void element2case(unsigned char * void Request::core(const char *root_auto_path, bool root_auto_fail, const char *site_auto_path, bool site_auto_fail, bool header_only) { + //_asm { int 3 } VStateless_class *main_class=0; bool need_rethrow=false; Exception rethrow_me; TRY { @@ -321,12 +322,12 @@ void Request::core(const char *root_auto VString body_vstring_before_post_process(*body_string); VString *body_vstring_after_post_process=&body_vstring_before_post_process; - // post-process + // @postprocess if(Value *value=main_class->get_element(*post_process_method_name)) if(Junction *junction=value->get_junction()) if(const Method *method=junction->method) { // preparing to pass parameters to - // @post-process[data] + // @postprocess[data] VMethodFrame frame(pool(), *junction, false); frame.set_self(*main_class); @@ -341,7 +342,7 @@ void Request::core(const char *root_auto // extract response body Value *body_value=static_cast( response.fields().get(*body_name)); - if(body_value) // there is some $request.body + if(body_value) // there is some $response.body body_file=body_value->as_vfile(); // OK. write out the result @@ -542,12 +543,12 @@ VStateless_class *Request::use_buf(const return &cclass; } -/// @test with commandline start "parser3 a.html" so that ^load[a.cfg] worked! [now doesnt] const String& Request::relative(const char *apath, const String& relative_name) { int lpath_buf_size=strlen(apath)+1; char *lpath=(char *)malloc(lpath_buf_size); memcpy(lpath, apath, lpath_buf_size); - rsplit(lpath, '/'); + if(!rsplit(lpath, '/')) + strcpy(lpath, "."); String& result=*NEW String(pool(), lpath); result << "/" << relative_name; return result;