|
From: <c99...@us...> - 2007-09-02 23:53:51
|
Revision: 503
http://cadcdev.svn.sourceforge.net/cadcdev/?rev=503&view=rev
Author: c99koder
Date: 2007-09-02 16:53:47 -0700 (Sun, 02 Sep 2007)
Log Message:
-----------
Tiki: HTTP: Properly initialize the cookieJar, avoid a division by zero error
Modified Paths:
--------------
tiki/src/net/http/cookiejar.cpp
tiki/src/net/http/useragent.cpp
Modified: tiki/src/net/http/cookiejar.cpp
===================================================================
--- tiki/src/net/http/cookiejar.cpp 2007-08-30 22:07:55 UTC (rev 502)
+++ tiki/src/net/http/cookiejar.cpp 2007-09-02 23:53:47 UTC (rev 503)
@@ -186,6 +186,7 @@
}
void CookieJar::expireCookies() {
+ if(m_cookies.empty()) return;
list< list< Cookie * >::iterator > cookiesToExpire;
uint64 now = Tiki::Time::gettime();
for(list<Cookie *>::iterator iter = m_cookies.begin();
@@ -194,6 +195,7 @@
// check if cookie has expired
uint64 create = (*iter)->getCreateTime();
uint64 diff = now - create;
+ if(diff < 1) diff = 1;
// convert the diff from microseconds to milliseconds
diff /= 1000;
// convert the diff from milliseconds to seconds
Modified: tiki/src/net/http/useragent.cpp
===================================================================
--- tiki/src/net/http/useragent.cpp 2007-08-30 22:07:55 UTC (rev 502)
+++ tiki/src/net/http/useragent.cpp 2007-09-02 23:53:47 UTC (rev 503)
@@ -62,6 +62,7 @@
m_proxyHost = "";
m_proxyPort = 8080;
m_ignoreCookies = true;
+ m_cookieJar = NULL;
}
Response *HttpUserAgent::get(Request *req) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|