diff options
author | pixel <pixel> | 2007-05-09 09:12:39 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-05-09 09:12:39 +0000 |
commit | 84875ddd4f59f89012048ff03fef6508b8b5456a (patch) | |
tree | a688145429ee256bfddb0966a9c66259ce13e808 /include | |
parent | 6ce9b0beeb0a9c8dee0246f4fae79c6d5c8219af (diff) |
Made further progress into the implementation of a more generic HTTP action handler.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChainTasks.h | 21 | ||||
-rw-r--r-- | include/Domain.h | 2 | ||||
-rw-r--r-- | include/HttpServ.h | 6 |
3 files changed, 26 insertions, 3 deletions
diff --git a/include/ChainTasks.h b/include/ChainTasks.h new file mode 100644 index 0000000..428c964 --- /dev/null +++ b/include/ChainTasks.h @@ -0,0 +1,21 @@ +#ifndef __CHAINTASKS_H__ +#define __CHAINTASKS_H__ + +#include <vector> + +#include <Task.h> + +class ChainTasks : public Task { + public: + typedef std::vector<Task *> tasklist_t; + ChainTasks(tasklist_t); + virtual ~ChainTasks(); + virtual String GetName(); + virtual int Do() throw (GeneralException); + private: + tasklist_t tasklist; + typedef std::vector<Task *>::iterator tasklist_iter_t; + tasklist_iter_t pos; +}; + +#endif diff --git a/include/Domain.h b/include/Domain.h index ef103c2..3a51d9f 100644 --- a/include/Domain.h +++ b/include/Domain.h @@ -10,7 +10,7 @@ class Domain : public Base { virtual ~Domain(); static Domain * find_domain(const String & url); void OnTop(); - virtual void Do(const HttpRequest &) = 0; + virtual void Do(const HttpRequest &, HttpResponse *) throw (GeneralException) = 0; private: Domain * find_domain_r(const String & url); static Domain * head; diff --git a/include/HttpServ.h b/include/HttpServ.h index aec3aad..34de345 100644 --- a/include/HttpServ.h +++ b/include/HttpServ.h @@ -25,6 +25,7 @@ class HttpResponse : public Base { HttpResponse(); virtual ~HttpResponse(); Task * BuildResponse(Handle * out); + void PrepareResponse(Handle * b = 0); String mime_type; String location; @@ -33,15 +34,17 @@ class HttpResponse : public Base { time_t last_modified; Buffer contents; bool cache; + Task * builder; private: String code_to_string(); + bool already_prepared; }; class HttpRequest : public Base { public: Variables * vars, * headers; - String url; + String uri; }; class Action; @@ -61,7 +64,6 @@ class HttpServ : public Task { String name; int localport; String root; - HttpResponse response; }; extern String endhl, endnl; |