diff options
author | pixel <pixel> | 2007-05-09 07:12:33 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-05-09 07:12:33 +0000 |
commit | 6ce9b0beeb0a9c8dee0246f4fae79c6d5c8219af (patch) | |
tree | 2356628a3ecb6cfd6a8b6f4364bc227520ac59bd /include | |
parent | 976f094b10a8a95348f02cc5049000228babe7a2 (diff) |
First new bricks of a more global domain system.
Diffstat (limited to 'include')
-rw-r--r-- | include/Domain.h | 21 | ||||
-rw-r--r-- | include/HttpServ.h | 45 |
2 files changed, 48 insertions, 18 deletions
diff --git a/include/Domain.h b/include/Domain.h new file mode 100644 index 0000000..ef103c2 --- /dev/null +++ b/include/Domain.h @@ -0,0 +1,21 @@ +#ifndef __DOMAIN_H__ +#define __DOMAIN_H__ + +#include <BRegex.h> +#include <HttpServ.h> + +class Domain : public Base { + public: + Domain(const Regex &); + virtual ~Domain(); + static Domain * find_domain(const String & url); + void OnTop(); + virtual void Do(const HttpRequest &) = 0; + private: + Domain * find_domain_r(const String & url); + static Domain * head; + Domain * next, * prev; + Regex pattern; +}; + +#endif diff --git a/include/HttpServ.h b/include/HttpServ.h index db454e0..aec3aad 100644 --- a/include/HttpServ.h +++ b/include/HttpServ.h @@ -9,23 +9,6 @@ #include <Handle.h> #include <Exceptions.h> -class Action; -class HttpServ : public Task { - public: - HttpServ(Action *, int = 1500, const String & = String("GruiK Server v0.2")) throw (GeneralException); - virtual ~HttpServ(); - virtual String GetName(); - - protected: - virtual int Do() throw (GeneralException); - - private: - Socket Listener; - Action * p; - String name; - int localport; -}; - class HttpResponse : public Base { public: typedef enum { @@ -51,10 +34,36 @@ class HttpResponse : public Base { Buffer contents; bool cache; - public: + private: String code_to_string(); }; +class HttpRequest : public Base { + public: + Variables * vars, * headers; + String url; +}; + +class Action; +class HttpServ : public Task { + public: + HttpServ(Action *, int = 1500, const String & = String("GruiK Server v0.2")) throw (GeneralException); + virtual ~HttpServ(); + virtual String GetName(); + void SetRoot(const String &); + + protected: + virtual int Do() throw (GeneralException); + + private: + Socket Listener; + Action * p; + String name; + int localport; + String root; + HttpResponse response; +}; + extern String endhl, endnl; #include <Action.h> |