--- parser3/src/main/pa_request.C 2002/06/25 13:55:14 1.214 +++ parser3/src/main/pa_request.C 2002/08/01 10:31:38 1.217 @@ -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.214 2002/06/25 13:55:14 paf Exp $ + $Id: pa_request.C,v 1.217 2002/08/01 10:31:38 paf Exp $ */ #include "pa_sapi.h" @@ -283,7 +283,7 @@ gettimeofday(&mt[2],NULL); // extract response body Value *body_value=static_cast( response.fields().get(*body_name)); - if(body_value) // there is some $response.body + if(body_value) // there is some $response:body body_file=body_value->as_vfile(); else if(lorigins_mode) response.fields().put(*content_type_name, @@ -502,8 +502,11 @@ VStateless_class *Request::use_buf(const execute_nonvirtual_method(cclass, *conf_method_name, vfilespec, 0/*no result needed*/, &method_called); - if(method_called) + if(method_called) { + if(!main_class) + main_class=&cclass; // for root auto.p, when main_class not assigned yet configure_admin(cclass, &method_called->name); + } // locate and execute possible @auto[] static execute_nonvirtual_method(cclass, @@ -513,19 +516,18 @@ VStateless_class *Request::use_buf(const } 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); - if(!rsplit(lpath, '/')) - strcpy(lpath, "."); - String& result=*NEW String(pool(), lpath); - result << "/" << relative_name; + int hpath_buf_size=strlen(apath)+1; + char *hpath=(char *)malloc(hpath_buf_size); + memcpy(hpath, apath, hpath_buf_size); + String& result=*NEW String(pool()); + if(rsplit(hpath, '/')) // if something/splitted + result << hpath << "/"; + result << relative_name; return result; } const String& Request::absolute(const String& relative_name) { - char *relative_name_cstr=relative_name.cstr(); - if(relative_name_cstr[0]=='/') { + if(relative_name.first_char()=='/') { String& result=*NEW String(pool(), info.document_root); result << relative_name; return result;