summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2007-06-17 15:21:50 +0000
committerpixel <pixel>2007-06-17 15:21:50 +0000
commit0ccb4c76a3b5ad65fe1b3ae2dee5095483de8d8d (patch)
treee4386fbeb08df4aed40f5b00f914203f35162df9 /lib
parentaf928d0663646b8cfb1bd87f160b5725eecb7534 (diff)
Adding source and dest IP/port.
Diffstat (limited to 'lib')
-rw-r--r--lib/HttpServ.cc6
-rw-r--r--lib/LuaHttp.cc18
2 files changed, 22 insertions, 2 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc
index e24a49d..bc836c4 100644
--- a/lib/HttpServ.cc
+++ b/lib/HttpServ.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: HttpServ.cc,v 1.50 2007-06-13 07:01:28 pixel Exp $ */
+/* $Id: HttpServ.cc,v 1.51 2007-06-17 15:21:50 pixel Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -227,6 +227,10 @@ int ProcessRequest::Do() throw(GeneralException) {
request.uri = Uri;
request.login = login;
request.password = password;
+ request.lip = s.GetAddr();
+ request.dip = s.GetDistantAddr();
+ request.lport = s.GetPort();
+ request.dport = s.GetDistantPort();
d->Do(request, &response);
a = response.BuildResponse(&s);
} else {
diff --git a/lib/LuaHttp.cc b/lib/LuaHttp.cc
index d3cbd2a..736739e 100644
--- a/lib/LuaHttp.cc
+++ b/lib/LuaHttp.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: LuaHttp.cc,v 1.15 2007-06-11 21:24:48 pixel Exp $ */
+/* $Id: LuaHttp.cc,v 1.16 2007-06-17 15:21:50 pixel Exp $ */
#include "md5.h"
#include "Domain.h"
@@ -348,6 +348,22 @@ class LuaDomain : public Domain {
L->push("password");
L->push(req.password);
L->settable();
+
+ L->push("lip");
+ L->push((lua_Number) req.lip);
+ L->settable();
+
+ L->push("dip");
+ L->push((lua_Number) req.dip);
+ L->settable();
+
+ L->push("lport");
+ L->push((lua_Number) req.lport);
+ L->settable();
+
+ L->push("dport");
+ L->push((lua_Number) req.dport);
+ L->settable();
LuaHttpResponse r(res);
r.push(L);