--- parser3/src/include/pa_request.h 2009/05/04 09:26:08 1.192 +++ parser3/src/include/pa_request.h 2009/08/30 05:28:41 1.198 @@ -8,7 +8,7 @@ #ifndef PA_REQUEST_H #define PA_REQUEST_H -static const char * const IDENT_REQUEST_H="$Date: 2009/05/04 09:26:08 $"; +static const char * const IDENT_REQUEST_H="$Date: 2009/08/30 05:28:41 $"; #include "pa_pool.h" #include "pa_hash.h" @@ -118,10 +118,10 @@ private: ///@{ core data /// classes - HashStringValue fclasses; + HashString fclasses; /// already used files to avoid cyclic uses - Hash used_files; + HashString used_files; /// list of all used files, Operation::file_no = index to it Array file_list; @@ -152,6 +152,7 @@ public: /// interrupted flag, raised on signals [SIGPIPE] bool finterrupted; Skip fskip; + int fin_cycle; public: uint register_file(String::Body file_spec); @@ -187,7 +188,8 @@ public: ~Request(); /// global classes - HashStringValue& classes() { return fclasses; } + HashString& classes() { return fclasses; } + Value* get_class(const String& name); /** core request processing @@ -203,6 +205,7 @@ public: void execute(ArrayOperation& ops); // execute.C void op_call(VMethodFrame &frame); void op_call_write(VMethodFrame &frame); + void op_call(VMethodFrame &frame, bool constructing); /// execute ops with anti-recoursion check void recoursion_checked_execute(/*const String& name, */ArrayOperation& ops) { // anti_endless_execute_recoursion @@ -310,6 +313,9 @@ public: void set_skip(Skip askip) { fskip=askip; } Skip get_skip() { return fskip; } + void set_in_cycle(int adelta) { fin_cycle+=adelta; } + bool get_in_cycle() { return fin_cycle>0; } + public: /// info from web server @@ -335,7 +341,7 @@ public: VConsole& console; /// classes configured data - Hash classes_conf; + HashString classes_conf; public: // status read methods @@ -510,15 +516,20 @@ public: } }; +/// Auto-object used for break out of cycle check +class InCycle { + Request& frequest; +public: + InCycle(Request& arequest) : frequest(arequest) { + frequest.set_in_cycle(1); + } + ~InCycle() { + frequest.set_in_cycle(-1); + } +}; // defines for externs -#define CONTENT_TRANSFER_ENCODING_NAME "content-transfer-encoding" -#define CONTENT_DISPOSITION_NAME "content-disposition" -#define CONTENT_DISPOSITION_ATTACHMENT "attachment" -#define CONTENT_DISPOSITION_INLINE "inline" -#define CONTENT_DISPOSITION_FILENAME_NAME "filename" - #define EXCEPTION_HANDLED_PART_NAME "handled" @@ -528,12 +539,6 @@ extern const String main_method_name; extern const String auto_method_name; extern const String body_name; -extern const String content_transfer_encoding_name; -extern const String content_disposition_name; -extern const String content_disposition_attachment; -extern const String content_disposition_inline; -extern const String content_disposition_filename_name; - extern const String exception_type_part_name; extern const String exception_source_part_name; extern const String exception_comment_part_name;