1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-04 08:35:05 -05:00

cookies: Remove redundant expired check

Expired cookies have already been purged at a later expiration time
before this check, so remove the redundant check.

closes #2962
This commit is contained in:
Daniel Gustafsson 2018-09-09 08:52:04 +02:00 committed by Daniel Stenberg
parent 37da149670
commit c3654df166
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1218,7 +1218,6 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
{ {
struct Cookie *newco; struct Cookie *newco;
struct Cookie *co; struct Cookie *co;
time_t now = time(NULL);
struct Cookie *mainco = NULL; struct Cookie *mainco = NULL;
size_t matches = 0; size_t matches = 0;
bool is_ip; bool is_ip;
@ -1236,11 +1235,8 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
co = c->cookies[myhash]; co = c->cookies[myhash];
while(co) { while(co) {
/* only process this cookie if it is not expired or had no expire /* if the cookie requires we're secure we must only continue if we are! */
date AND that if the cookie requires we're secure we must only if(co->secure?secure:TRUE) {
continue if we are! */
if((!co->expires || (co->expires > now)) &&
(co->secure?secure:TRUE)) {
/* now check if the domain is correct */ /* now check if the domain is correct */
if(!co->domain || if(!co->domain ||