|
|
| version 1.50, 2001/03/13 17:54:13 | version 1.59, 2001/03/18 14:45:26 |
|---|---|
| Line 18 | Line 18 |
| #include "pa_vobject.h" | #include "pa_vobject.h" |
| #include "pa_venv.h" | #include "pa_venv.h" |
| #include "pa_vform.h" | #include "pa_vform.h" |
| #include "pa_vrequest.h" | |
| #include "pa_vresponse.h" | |
| #ifndef NO_STRING_ORIGIN | #ifndef NO_STRING_ORIGIN |
| # define COMPILE_PARAMS \ | # define COMPILE_PARAMS \ |
| Line 42 class Request : public Pooled { | Line 44 class Request : public Pooled { |
| friend Temp_lang; | friend Temp_lang; |
| public: | public: |
| struct Info { | |
| const char *document_root; | |
| const char *path_translated; | |
| const char *method; | |
| const char *query_string; | |
| const char *uri; | |
| const char *content_type; | |
| size_t content_length; | |
| }; | |
| Request(Pool& apool, | Request(Pool& apool, |
| String::Untaint_lang alang, | Info& ainfo, |
| String::Untaint_lang adefault_lang | |
| char *adocument_root, | |
| char *apage_filespec | |
| ); | ); |
| ~Request() {} | ~Request() {} |
| Line 54 public: | Line 64 public: |
| Hash& classes() { return fclasses; } | Hash& classes() { return fclasses; } |
| // core request processing | // core request processing |
| char *core(bool& error); | void core(Exception& system_exception, |
| const char *sys_auto_path1, | |
| const char *sys_auto_path2); | |
| void execute(const Array& ops); | void execute(const Array& ops); |
| Line 71 public: | Line 83 public: |
| const String *name=0, | const String *name=0, |
| bool intercept_string=true); // execute.C | bool intercept_string=true); // execute.C |
| // write(const) = clean | |
| void write(const String& astring) { | void write(const String& astring) { |
| wcontext->write(astring, String::Untaint_lang::NO); // write(const) = clean | wcontext->write(astring, String::Untaint_lang::NO); |
| } | } |
| // appending, sure of clean string inside | |
| void write_no_lang(String& astring) { | void write_no_lang(String& astring) { |
| // appending, sure of clean string inside | |
| wcontext->write(astring, String::Untaint_lang::NO); | wcontext->write(astring, String::Untaint_lang::NO); |
| } | } |
| // appending string, passing language built into string being written | |
| void write_pass_lang(String& astring) { | |
| wcontext->write(astring, String::Untaint_lang::PASS_APPEND); | |
| } | |
| // appending possible string, assigning untaint language | |
| void write_assign_lang(Value& avalue) { | void write_assign_lang(Value& avalue) { |
| // appending possible string, assigning untaint language | |
| wcontext->write(avalue, flang); | wcontext->write(avalue, flang); |
| } | } |
| // appending possible string, passing language built into string being written | |
| void write_pass_lang(Value& avalue) { | void write_pass_lang(Value& avalue) { |
| // appending possible string, passing language built into string being written | wcontext->write(avalue, String::Untaint_lang::PASS_APPEND); |
| wcontext->write(avalue, String::Untaint_lang::PASS_APPENDED); | |
| } | } |
| // appending sure value, that would be converted to clean string | |
| void write_no_lang(Value& avalue) { | void write_no_lang(Value& avalue) { |
| // appending sure value, no strings inside | wcontext->write(avalue, String::Untaint_lang::NO); |
| wcontext->write(avalue, String::Untaint_lang::NO); | } |
| // appending sure value, not VString | |
| void write_expr_result(Value& avalue) { | |
| wcontext->write(avalue); | |
| } | } |
| void fail_if_junction_(bool is, Value& value, const String& method_name, char *msg); | void fail_if_junction_(bool is, Value& value, const String& method_name, char *msg); |
| Line 99 public: | Line 119 public: |
| public: | public: |
| // | |
| Info& info; | |
| // default base | // default base |
| VClass root_class; | VClass ROOT; |
| // $env:fields here | // $env:fields here |
| VEnv env_class; | VEnv env; |
| // $form:elements here | // $form:elements here |
| VForm form_class; | VForm form; |
| // $request:elements here | |
| VRequest request; | |
| // $response: | |
| VResponse response; | |
| // contexts | // contexts |
| Value *self, *root, *rcontext; | Value *self, *root, *rcontext; |
| Line 124 private: // compile.C | Line 151 private: // compile.C |
| private: // execute.C | private: // execute.C |
| char *execute_method(Value& aself, const Method& method, bool return_cstr); | const String *execute_method(Value& aself, const Method& method, |
| char *execute_method(Value& aself, const String& method_name, bool return_cstr); | bool return_cstr=true); |
| const String *execute_method(Value& aself, const String& method_name, | |
| bool return_cstr=true); | |
| Value *get_element(); | Value *get_element(); |
| Line 133 private: // lang&raw | Line 162 private: // lang&raw |
| String::Untaint_lang flang; | String::Untaint_lang flang; |
| private: // defaults | |
| const String::Untaint_lang fdefault_lang; | |
| Value *fdefault_content_type; | |
| private: // lang manipulation | private: // lang manipulation |
| String::Untaint_lang set_lang(String::Untaint_lang alang) { | String::Untaint_lang set_lang(String::Untaint_lang alang) { |
| Line 144 private: // lang manipulation | Line 178 private: // lang manipulation |
| flang=alang; | flang=alang; |
| } | } |
| private: // web | private: |
| const char *fdocument_root; | |
| const char *fpage_filespec; | |
| void output_result(const String& body_string); | |
| }; | }; |
| class Temp_lang { | class Temp_lang { |