--- parser3/src/main/pa_request.C 2003/01/31 16:05:59 1.245.2.7 +++ parser3/src/main/pa_request.C 2003/02/03 11:55:33 1.245.2.12 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_REQUEST_C="$Date: 2003/01/31 16:05:59 $"; +static const char* IDENT_REQUEST_C="$Date: 2003/02/03 11:55:33 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -41,6 +41,9 @@ const char* ORIGINS_CONTENT_TYPE="text/p // globals StringPtr main_method_name(new String(MAIN_METHOD_NAME)); +StringPtr content_disposition_name(new String(CONTENT_DISPOSITION_NAME)); +StringPtr content_disposition_value(new String(CONTENT_DISPOSITION_VALUE)); +StringPtr content_disposition_filename_name(new String(CONTENT_DISPOSITION_FILENAME_NAME)); // defines for statics @@ -91,7 +94,7 @@ Request::Request(SAPI_Info& asapi_info, main_class(VClassMAIN_create()), charsets(pool(), *UTF8_charset, *UTF8_charset, *UTF8_charset), // default charsets - response(new VResponse(arequest_info, charsets)), + response(new VResponse(fpool, arequest_info, charsets)), form(new VForm), mail(new VMail), cookie(new VCookie) @@ -113,7 +116,7 @@ Request::Request(SAPI_Info& asapi_info, // status class if(status_allowed) classes().put(StringPtr(new String(STATUS_CLASS_NAME)), - ValuePtr(new VStatus)); + ValuePtr(new VStatus(pool()))); // request class classes().put(StringPtr(new String(REQUEST_CLASS_NAME)), ValuePtr(new VRequest(arequest_info, charsets))); @@ -150,7 +153,7 @@ Request::~Request() { #endif } -Value* Request::get_self() { return method_frame?&method_frame->self():0; } +ValuePtr Request::get_self() { return method_frame?method_frame->get_self():ValuePtr(0); } static void load_charset(HashStringValue::key_type akey, HashStringValue::value_type avalue, int) { ::charsets.load_charset(akey, avalue->as_string(0)); @@ -267,7 +270,7 @@ gettimeofday(&mt[0],NULL); mime_types=table; // filling form fields - form->fill_fields_and_tables(charsets, request_info); + form->fill_fields_and_tables(pool(), charsets, request_info); // filling cookies cookie->fill_fields(pool(), request_info); @@ -280,7 +283,7 @@ gettimeofday(&mt[0],NULL); gettimeofday(&mt[1],NULL); #endif // execute @main[] - StringPtr body_string=execute_virtual_method(*main_class, main_method_name); + StringPtr body_string=execute_virtual_method(main_class, main_method_name); if(!body_string) throw Exception("parser.runtime", Exception::undefined_source, @@ -300,7 +303,7 @@ gettimeofday(&mt[2],NULL); // preparing to pass parameters to // @postprocess[data] VMethodFrame frame(pool(), method->name, *junction, 0/*no parent*/); - frame.set_self(*main_class); + frame.set_self(main_class); frame.store_param(body_vstring_before_post_process); body_vstring_after_post_process= @@ -398,7 +401,7 @@ t[9]-t[3] // preparing to pass parameters to // @unhandled_exception[exception;stack] VMethodFrame frame(pool(), method->name, *junction, 0/*no caller*/); - frame.set_self(*main_class); + frame.set_self(main_class); // $exception frame.store_param(exception2vhash(e)); @@ -588,7 +591,7 @@ static void add_header_attribute( } void Request::output_result(VFilePtr body_file, bool header_only, bool as_attachment) { // header: cookies - cookie->output_result(sapi_info); + cookie->output_result(pool(), sapi_info); ValuePtr body_file_content_type; // set content-type