From 05a34ba1975a57444c9cdb507c4707b4a63b4bf7 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 15 Oct 2008 18:31:13 -0700 Subject: Adding matches into the LuaDomain controler, in order to handle submatches directly at Domain matches. --- include/Domain.h | 4 ++-- include/HttpServ.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include') 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 #include #include +#include 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; -- cgit v1.2.3