Can't store cookie

2 views
Skip to first unread message

ywatase

unread,
Nov 29, 2010, 9:17:08 AM11/29/10
to Siege Users
Hi.

On my environment, siege can't store cookie which isn't set expire
time.

my environment
OS: Debian squeeze 64bit
CPU: Intel Core2Duo
GCC: gcc (Debian 4.4.5-6) 4.4.5

exactlly speaking, siege store cookie but cookie will expire
immediately.

In cookie.c line 83, 1 regard as 32bit integer but on my env time_t is
64bit integer and ck->expires default value become 1. so always ck-
>expires less than now and cookie will delete.

Please check my patch.

diff -ru siege-2.70/src/cookie.c siege-2.70.patched/src/cookie.c
--- siege-2.70/src/cookie.c 2010-05-08 23:55:12.000000000 +0900
+++ siege-2.70.patched/src/cookie.c 2010-11-29 22:58:24.410809873
+0900
@@ -80,7 +80,7 @@
ck->expires = 0;
ck->expires = ~ck->expires;
if(ck->expires < 0){
- ck->expires = ~(1 << ((sizeof(ck->expires) * 8) - 1));
+ ck->expires = ~((time_t) 1 << ((sizeof(ck->expires) * 8) - 1));
}
if(ck->expires < 0){
ck->expires = (ck->expires >> 1) * -1;

je...@joedog.org

unread,
Nov 29, 2010, 9:24:13 AM11/29/10
to siege...@googlegroups.com
Hi ywatase,

Thanks for the patch. I need to check this against previous versions. I'm
starting to think we're playing tug-a-war. We might need to add some
platform specific macros around this.

Jeff

je...@joedog.org

unread,
Nov 30, 2010, 10:56:33 AM11/30/10
to siege...@googlegroups.com
ywatase,

This was addressed in 2.71 beta one. The current block is this:

if(ck->expires < 0){
ck->expires = ~(1UL << ((sizeof(ck->expires) * 8) - 1));
}

Could you either download a beta or amend cookie.c with the above block
and let me know how that works on your system?

Jeff

Reply all
Reply to author
Forward
0 new messages