--- parser3/src/main/pa_request.C 2003/04/08 12:47:31 1.245.2.37.2.29 +++ parser3/src/main/pa_request.C 2003/04/11 16:05:43 1.245.2.37.2.32 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_REQUEST_C="$Date: 2003/04/08 12:47:31 $"; +static const char* IDENT_REQUEST_C="$Date: 2003/04/11 16:05:43 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -189,8 +189,11 @@ Request::~Request() { Value& Request::get_self() { return method_frame/*always have!*/->self(); } -static void load_charset(HashStringValue::key_type akey, HashStringValue::value_type avalue, int) { - ::charsets.load_charset(*new String(akey, String::L_CLEAN), avalue->as_string()); +static void load_charset(HashStringValue::key_type akey, + HashStringValue::value_type avalue, + Request_charsets* charsets) { + const StringBody NAME=String(akey, String::L_CLEAN).change_case(charsets->source(), String::CC_UPPER); + ::charsets.load_charset(*charsets, NAME, avalue->as_string()); } void Request::configure_admin(VStateless_class& conf_class) { if(configure_admin_done) @@ -210,7 +213,7 @@ void Request::configure_admin(VStateless if(Value* vcharsets=conf_class.get_element(charsets_name, conf_class, false)) { if(!vcharsets->is_string()) if(HashStringValue* charsets=vcharsets->get_hash()) - charsets->for_each(load_charset, 0); + charsets->for_each(load_charset, &this->charsets); else throw Exception("parser.runtime", 0, @@ -566,7 +569,7 @@ void Request::use_file(VStateless_class& if(!entry_exists(*file_spec)) return; - if(const char* source=file_read_text(charsets.source(), *file_spec, fail_on_read_problem)) + if(const char* source=file_read_text(charsets, *file_spec, fail_on_read_problem)) use_buf(aclass, source, main_alias, register_file(*file_spec)); } @@ -687,7 +690,8 @@ const String& Request::mime_type_of(cons if(mime_types) if(const char* cext=strrchr(user_file_name_cstr, '.')) { String sext(++cext); - if(mime_types->locate(0, sext.change_case(charsets.source(), String::CC_LOWER))) + Table::Action_options options; + if(mime_types->locate(0, sext.change_case(charsets.source(), String::CC_LOWER), options)) if(const String* result=mime_types->item(1)) return *result; else @@ -772,5 +776,3 @@ Request::Exception_details Request::get_ return Request::Exception_details(trace, problem_source, vhash); } - -// \ No newline at end of file