--- parser3/src/main/pa_request.C 2002/10/31 12:22:13 1.236.4.1 +++ parser3/src/main/pa_request.C 2002/12/02 10:07:39 1.243 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_REQUEST_C="$Date: 2002/10/31 12:22:13 $"; +static const char* IDENT_REQUEST_C="$Date: 2002/12/02 10:07:39 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -68,7 +68,8 @@ Request::Request(Pool& apool, #ifdef RESOURCES_DEBUG , sql_connect_time(0),sql_request_time(0) #endif - , method_frame(0), rcontext(0), wcontext(0) + , method_frame(0), rcontext(0), wcontext(0), + finterrupted(false) { // default charsets pool().set_source_charset(*utf8_charset); @@ -139,12 +140,13 @@ void Request::configure_admin(VStateless ] */ if(Value *vcharsets=conf_class.get_element(*charsets_name, conf_class, false)) { - if(Hash *charsets=vcharsets->get_hash(0)) - charsets->for_each(load_charset); - else if(!vcharsets->get_string()) - throw Exception("parser.runtime", - 0, - "$" MAIN_CLASS_NAME ":" CHARSETS_NAME " must be hash"); + if(!vcharsets->is_string()) + if(Hash *charsets=vcharsets->get_hash(0)) + charsets->for_each(load_charset); + else + throw Exception("parser.runtime", + 0, + "$" MAIN_CLASS_NAME ":" CHARSETS_NAME " must be hash"); } // configure method_frame options @@ -538,7 +540,8 @@ const String& Request::absolute(const St result << relative_name; return result; } else - return relative(info.path_translated, relative_name); + return relative_name.pos("://")<0? relative(info.path_translated, relative_name) + :relative_name; // something like "http://xxx" } static void add_header_attribute(const Hash::Key& aattribute, Hash::Val *ameaning, @@ -553,7 +556,8 @@ static void add_header_attribute(const H SAPI::add_header_attribute(pool, aattribute.cstr(), - attributed_meaning_to_string(lmeaning, String::UL_HTTP_HEADER).cstr()); + attributed_meaning_to_string(lmeaning, String::UL_HTTP_HEADER, false) + .cstr(String::UL_UNSPECIFIED)); } void Request::output_result(const VFile& body_file, bool header_only) { // header: cookies @@ -576,7 +580,9 @@ void Request::output_result(const VFile& if(VString *vfile_name=static_cast(body_file.fields().get(*name_name))) if(vfile_name->string()!=NONAME_DAT) { VHash& vhash=*NEW VHash(pool()); - vhash.hash(0).put(*content_disposition_filename_name, vfile_name); + Hash& hash=vhash.hash(0); + hash.put(*value_name, NEW VString(*content_disposition_value)); + hash.put(*content_disposition_filename_name, vfile_name); response.fields().put(*content_disposition_name, &vhash); }