diff options
Diffstat (limited to 'lib/LuaHttp.cc')
-rw-r--r-- | lib/LuaHttp.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/LuaHttp.cc b/lib/LuaHttp.cc index a524cc1..a3c728a 100644 --- a/lib/LuaHttp.cc +++ b/lib/LuaHttp.cc @@ -486,6 +486,21 @@ void LuaDomain::Do(const HttpRequest & req, HttpResponse * res) throw (GeneralEx L->push("dport"); L->push((lua_Number) req.dport); L->settable(); + + L->push("matches"); + L->newtable(); + for (i = 0; i < MAX_MATCHES; i++) { + if (req.pmatches[i].rm_so == -1) + continue; + L->newtable(); + L->push("start"); + L->push((lua_Number) req.pmatches[i].rm_so + 1); + L->settable(); + L->push("size"); + L->push((lua_Number) req.pmatches[i].rm_eo - req.pmatches[i].rm_so); + L->settable(); + L->settable(); + } LuaHttpResponse r(res); r.push(L); |