--- parser3/src/main/pa_request.C 2001/10/30 15:08:20 1.173 +++ parser3/src/main/pa_request.C 2001/11/08 11:04:13 1.178 @@ -2,9 +2,9 @@ Parser: request class main part. @see compile.C and execute.C. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_request.C,v 1.173 2001/10/30 15:08:20 paf Exp $ + $Id: pa_request.C,v 1.178 2001/11/08 11:04:13 paf Exp $ */ #include "pa_config_includes.h" @@ -26,6 +26,7 @@ extern "C" unsigned char pcre_default_ta #include "pa_vfile.h" #include "pa_dictionary.h" #include "pa_charset_manager.h" +#include "pa_charset_connection.h" /// content type of exception response, when no @MAIN:exception handler defined const char *UNHANDLED_EXCEPTION_CONTENT_TYPE="text/plain"; @@ -41,7 +42,8 @@ static void load_charset(const Hash::Key Value& value=*static_cast(avalue); Hash& CTYPE=*static_cast(info); - Charset_connection& connection=charset_manager->get_connection(akey, value.as_string()); + Charset_connection& connection= + charset_manager->get_connection(akey, value.as_string()); // charset->pcre_tables CTYPE.put(akey, connection.pcre_tables()); @@ -54,6 +56,7 @@ Request::Request(Pool& apool, stack(apool), OP(*MOP_create(apool)), env(apool), + status(apool), form(apool), math(apool), request(apool, *this), @@ -73,6 +76,9 @@ Request::Request(Pool& apool, anti_endless_execute_recoursion(0), trace(apool) { + // maybe expire old caches + cache_managers->maybe_expire(); + /// directly used // operators OP.register_directly_used(*this); @@ -83,6 +89,8 @@ Request::Request(Pool& apool, /// methodless // env class classes().put(*NEW String(pool(), ENV_CLASS_NAME), &env); + // status class + classes().put(*NEW String(pool(), STATUS_CLASS_NAME), &status); // request class classes().put(*NEW String(pool(), REQUEST_CLASS_NAME), &request); // cookie class @@ -111,7 +119,6 @@ void Request::core( const char *root_config_filespec, bool root_config_fail_on_read_problem, const char *site_config_filespec, bool site_config_fail_on_read_problem, bool header_only) { - //_asm { int 3 } try { char *auto_filespec=(char *)malloc(MAX_STRING); @@ -532,8 +539,8 @@ const String& Request::absolute(const St static void add_header_attribute(const Hash::Key& aattribute, Hash::Val *ameaning, void *info) { - String *attribute_to_exclude=static_cast(info); - if(aattribute==*attribute_to_exclude) + Request& r=*static_cast(info); + if(aattribute==*body_name) return; Value& lmeaning=*static_cast(ameaning); @@ -563,12 +570,12 @@ 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().put(*content_disposition_filename_name, vfile_name); + vhash.hash(0).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); + response.fields().for_each(add_header_attribute, this); // prepare... const void *body=body_file.value_ptr();