--- parser3/src/main/pa_request.C 2001/04/03 07:02:43 1.91 +++ parser3/src/main/pa_request.C 2001/04/04 10:50:36 1.95 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_request.C,v 1.91 2001/04/03 07:02:43 paf Exp $ + $Id: pa_request.C,v 1.95 2001/04/04 10:50:36 paf Exp $ */ #include "pa_config_includes.h" @@ -51,7 +51,8 @@ Request::Request(Pool& apool, info(ainfo), used_files(apool), default_content_type(0), - mime_types(0) + mime_types(0), + connection(0), protocol2library(0) { // root superclass, // parent of all classes, @@ -98,8 +99,6 @@ static void add_header_attribute(const H the file user requested us to process all located classes become children of one another, composing class we name 'MAIN' - - @test post-process */ void Request::core(const char *root_auto_path, bool root_auto_fail, const char *site_auto_path, bool site_auto_fail, @@ -196,6 +195,11 @@ void Request::core(const char *root_auto if(Table *table=element->get_table()) pool().set_tag(table); + // $MAIN:SQL.drivers + if(Value *sql=main_class->get_element(*main_sql_name)) + if(Value *element=sql->get_element(*main_sql_drivers_name)) + protocol2library=element->get_table(); + // $MAIN:MIME-TYPES if(Value *element=main_class->get_element(*mime_types_name)) if(Table *table=element->get_table()) @@ -403,7 +407,6 @@ void Request::core(const char *root_auto THROW(rethrow_me.type(), rethrow_me.code(), rethrow_me.problem_source(), rethrow_me.comment()); - } VStateless_class *Request::use_file(const String& file_spec, bool fail_on_read_problem, @@ -483,6 +486,13 @@ void Request::output_result(const VFile& :NEW VString(*NEW String(pool(), DEFAULT_CONTENT_TYPE))); } + // content-disposition + if(VString *vfile_name=static_cast(body_file.fields().get(*name_name))) { + VHash& vhash=*NEW VHash(pool()); + vhash.hash().put(*content_disposition_filename_name, vfile_name); + response.fields().put(*content_disposition_name, &vhash); + } + // prepare header: $response:fields without :body response.fields().for_each(add_header_attribute, /*excluding*/ body_name);