--- parser3/src/main/pa_request.C 2005/12/16 10:15:12 1.280 +++ parser3/src/main/pa_request.C 2007/02/17 11:03:10 1.285 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_REQUEST_C="$Date: 2005/12/16 10:15:12 $"; +static const char * const IDENT_REQUEST_C="$Date: 2007/02/17 11:03:10 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -59,6 +59,7 @@ const char* ORIGINS_CONTENT_TYPE="text/p const String main_method_name(MAIN_METHOD_NAME); const String auto_method_name(AUTO_METHOD_NAME); const String content_disposition_name(CONTENT_DISPOSITION_NAME); +const String content_disposition_inline(CONTENT_DISPOSITION_INLINE); const String content_disposition_value(CONTENT_DISPOSITION_VALUE); const String content_disposition_filename_name(CONTENT_DISPOSITION_FILENAME_NAME); const String body_name(BODY_NAME); @@ -107,7 +108,7 @@ Request::Request(SAPI_Info& asapi_info, wcontext(0), flang(adefault_lang), fconnection(0), - finterrupted(false), + finterrupted(false),fskip(SKIP_NOTHING), // public #ifdef RESOURCES_DEBUG @@ -125,6 +126,7 @@ Request::Request(SAPI_Info& asapi_info, mail(*new VMail), response(*new VResponse(arequest_info, charsets)), cookie(*new VCookie), + console(*new VConsole), // private configure_admin_done(false), @@ -161,8 +163,7 @@ Request::Request(SAPI_Info& asapi_info, // cookie class classes().put(String::Body(COOKIE_CLASS_NAME), &cookie); // console class - classes().put(String::Body(CONSOLE_CLASS_NAME), new VConsole()); - + classes().put(String::Body(CONSOLE_CLASS_NAME), &console); /// methoded // response class classes().put(response.get_class()->name(), &response); @@ -220,7 +221,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, &this->charsets); + charsets->for_each(load_charset, &this->charsets); else throw Exception("parser.runtime", 0, @@ -836,14 +837,12 @@ void Request::output_result(VFile* body_ if(vfile_name) { const String& sfile_name=vfile_name->as_string(); if(sfile_name!=NONAME_DAT) { - if(as_attachment) - { - VHash& hash=*new VHash(); - HashStringValue &h=hash.hash(); - h.put(value_name, new VString(content_disposition_value)); - h.put(content_disposition_filename_name, vfile_name); - response.fields().put(content_disposition_name, &hash); - } + VHash& hash=*new VHash(); + HashStringValue &h=hash.hash(); + h.put(value_name, new VString( as_attachment ? content_disposition_value : content_disposition_inline )); + + h.put(content_disposition_filename_name, vfile_name); + response.fields().put(content_disposition_name, &hash); if(!body_file_content_type) body_file_content_type=new VString(mime_type_of(sfile_name.cstr())); @@ -862,7 +861,7 @@ void Request::output_result(VFile* body_ // prepare header: $response:fields without :body Add_header_attribute_info info(*this); - response.fields().for_each(add_header_attribute, &info); + response.fields().for_each(add_header_attribute, &info); if(body_file_content_type) if(HashStringValue *hash=body_file_content_type->get_hash())