commit 706f90f7e53765c221c5374f6c1768ebc8ec102e
parent 09453567014d5e34afa3c2ccb0bcaa35f9359243
Author: Alexander Burger <abu@software-lab.de>
Date: Thu, 27 Jan 2011 10:38:43 +0100
Added session IP adddress check
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/http.l b/lib/http.l
@@ -1,9 +1,9 @@
-# 24jan11abu
+# 27jan11abu
# (c) Software Lab. Alexander Burger
# *Home *Gate *Host *Port *Port1 *Port% *Http1 *Chunked
# *Sock *Agent *ContLen *MPartLim *MPartEnd "*HtSet"
-# *Post *Url *Timeout *SesId *ConId
+# *Post *Url *Timeout *SesId *SesAdr *ConId *ConAdr
# *Referer *Cookies "*Cookies"
(default
@@ -127,6 +127,7 @@
(setq
*Port% (not *Gate)
*SesId (pack (in "/dev/urandom" (rd 7)) "~")
+ *SesAdr *Adr
*Sock (port *HPorts '*Port) )
(timeout *Timeout) ) )
@@ -183,7 +184,7 @@
(task (close S))
(off S)
(throw "http") ) )
- (if (<> *ConId *SesId)
+ (if (or (<> *ConId *SesId) (<> *ConAdr *SesAdr))
(if *ConId
(out S (http404))
(task (close S))
@@ -239,8 +240,11 @@
(use (L @X @Y Pil)
(setq *Http1 (format (car @H)) *Chunked (gt0 *Http1) Pil)
(if (index "~" @U)
- (setq *ConId (pack (head @ @U)) @U (cdr (nth @U @)))
- (off *ConId) )
+ (setq
+ *ConId (pack (head @ @U))
+ @U (cdr (nth @U @))
+ *ConAdr *Adr )
+ (off *ConId *ConAdr) )
(while (setq L (line))
(cond
((match '(~(chop "Host: ") . @X) L)