--- parser3/src/include/pa_request.h 2002/10/14 15:22:41 1.154 +++ parser3/src/include/pa_request.h 2002/12/19 10:17:41 1.159 @@ -8,7 +8,7 @@ #ifndef PA_REQUEST_H #define PA_REQUEST_H -static const char* IDENT_REQUEST_H="$Date: 2002/10/14 15:22:41 $"; +static const char* IDENT_REQUEST_H="$Date: 2002/12/19 10:17:41 $"; #include "pa_pool.h" #include "pa_hash.h" @@ -60,6 +60,7 @@ class Request : public Pooled { friend class Temp_lang; friend class Temp_connection; friend class Request_context_saver; + friend class Temp_request_self; public: #ifdef RESOURCES_DEBUG @@ -215,6 +216,9 @@ public: bool origins_mode(); + void interrupt() { finterrupted=true; } + bool interrupted() { return finterrupted; } + public: /// info from web server @@ -255,7 +259,6 @@ private: /// execution stack Stack stack; /// contexts - Value *self; VMethodFrame *method_frame; Value *rcontext; WContext *wcontext; @@ -264,11 +267,13 @@ private: /// current connection SQL_Connection *fconnection; //@} + /// interrupted flag, raised on signals [SIGPIPE] + bool finterrupted; public: // status read methods - Value *get_self() { return self; } VMethodFrame *get_method_frame() { return method_frame; } + Value *get_self(); private: // core data @@ -310,8 +315,7 @@ private: // execute.C /// for @main[] const String *execute_virtual_method(Value& aself, const String& method_name); - Value *get_element(const String *& remember_name, - bool can_call_operator, bool should_explode_junction=false/*there's only one place when true*/); + Value *get_element(const String *& remember_name, bool can_call_operator); private: // defaults @@ -347,7 +351,7 @@ private: // connection manipulation private: - void output_result(const VFile& body_file, bool header_only); + void output_result(const VFile& body_file, bool header_only, bool as_attachment); }; /// Auto-object used to save request context across ^try body @@ -359,7 +363,6 @@ class Request_context_saver { /// execution stack int stack; /// contexts - Value *self; VMethodFrame *method_frame; Value *rcontext; WContext *wcontext; @@ -372,7 +375,6 @@ public: Request_context_saver(Request& ar) : exception_trace(ar.exception_trace.top_index()), stack(ar.stack.top_index()), - self(ar.self), method_frame(ar.method_frame), rcontext(ar.rcontext), wcontext(ar.wcontext), @@ -382,7 +384,7 @@ public: void restore() { fr.exception_trace.top_index(exception_trace); fr.stack.top_index(stack); - fr.self=self; fr.method_frame=method_frame, fr.rcontext=rcontext; fr.wcontext=wcontext; + fr.method_frame=method_frame, fr.rcontext=rcontext; fr.wcontext=wcontext; fr.flang=flang; fr.fconnection=fconnection; }