diff options
author | Pixel <pixel@nobis-crew.org> | 2008-10-15 18:31:13 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2008-10-15 18:31:13 -0700 |
commit | 05a34ba1975a57444c9cdb507c4707b4a63b4bf7 (patch) | |
tree | b662358735c480cbf3b7a4be7c72eebb2e874c94 /include | |
parent | 465af69f28fddccdbcfea9a82aeadf3f106e6d12 (diff) |
Adding matches into the LuaDomain controler, in order to handle submatches directly at Domain matches.
Diffstat (limited to 'include')
-rw-r--r-- | include/Domain.h | 4 | ||||
-rw-r--r-- | include/HttpServ.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/Domain.h b/include/Domain.h index d091728..9cd8483 100644 --- a/include/Domain.h +++ b/include/Domain.h @@ -27,14 +27,14 @@ class Domain : public Base { public: Domain(const Regex &); virtual ~Domain(); - static Domain * find_domain(const String & url); + static Domain * find_domain(const String & url, int nmatches = 0, regmatch_t * pmatches = 0); void OnTop(); virtual void Do(const HttpRequest &, HttpResponse *) throw (GeneralException) = 0; static Domain * First(); Domain * Next(); String GetPattern(); private: - Domain * find_domain_r(const String & url); + Domain * find_domain_r(const String & url, int nmatches = 0, regmatch_t * pmatches = 0); static Domain * head; Domain * next, * prev; Regex pattern; diff --git a/include/HttpServ.h b/include/HttpServ.h index 2b2e5da..d8283aa 100644 --- a/include/HttpServ.h +++ b/include/HttpServ.h @@ -27,6 +27,7 @@ #include <Buffer.h> #include <Handle.h> #include <Exceptions.h> +#include <BRegex.h> class HttpResponse : public Base { public: @@ -65,12 +66,15 @@ class HttpResponse : public Base { bool already_prepared; }; +#define MAX_MATCHES 64 + class HttpRequest : public Base { public: Variables * vars, * headers; String method, uri, login, password; Uint32 lip, dip; int lport, dport; + regmatch_t pmatches[MAX_MATCHES]; }; class Action; |