fix bug 14145, approved chofmann

This commit is contained in:
morse%netscape.com 1999-09-26 09:38:07 +00:00
parent 53e8731812
commit 59f703061c
2 changed files with 8 additions and 2 deletions

View File

@ -1664,7 +1664,11 @@ COOKIE_SetCookieStringFromHttp(char * curURL, char * setCookieHeader, char * ser
expires = cookie_ParseDate(date);
*ptr=origLast;
}
sDate = cookie_ParseDate(server_date);
if (server_date) {
sDate = cookie_ParseDate(server_date);
} else {
sDate = time(NULL);
}
if( sDate && expires ) {
if( expires < sDate ) {
gmtCookieExpires=1;
@ -2192,9 +2196,11 @@ COOKIE_CookieViewerReturn(nsAutoString results) {
cookie = NS_STATIC_CAST(cookie_CookieStruct*, cookie_cookieList->ElementAt(count));
if (cookie && cookie_InSequence(gone, count)) {
cookie_FreeCookie(cookie);
cookie_cookiesChanged = PR_TRUE;
}
}
}
cookie_SaveCookies();
cookie_UnlockCookieList();
nsCRT::free(gone);

View File

@ -176,8 +176,8 @@ nsCookieHTTPNotify::AsyncExamineResponse(nsISupports *aContext) {
rv = pHTTPConnection->GetResponseHeader(header, &pDate);
}
if (NS_SUCCEEDED(rv)) {
COOKIE_SetCookieStringFromHttp((char*)(const char*)url, cookie, pDate);
if(pDate) {
COOKIE_SetCookieStringFromHttp((char*)(const char*)url, cookie, pDate);
nsCRT::free(pDate);
}
}