When reading cookies from a file, only run remove_expired once #2441

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
@clbr
Contributor

clbr commented Mar 30, 2018

Combined with #2440, this drops the cookie load time for 8k cookies from 178ms to 15ms. All tests pass.

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Mar 30, 2018

Member

Thanks, this looks like a great improvement. Try make checksrc to see the issues the CI reports:

./setopt.c:784:86: warning: Longer than 79 columns (LONGLINE)
           Curl_cookie_add(data, data->cookies, TRUE, FALSE, argptr + 11, NULL, NULL);
./setopt.c:788:82: warning: Longer than 79 columns (LONGLINE)
           Curl_cookie_add(data, data->cookies, FALSE, FALSE, argptr, NULL, NULL);
Member

bagder commented Mar 30, 2018

Thanks, this looks like a great improvement. Try make checksrc to see the issues the CI reports:

./setopt.c:784:86: warning: Longer than 79 columns (LONGLINE)
           Curl_cookie_add(data, data->cookies, TRUE, FALSE, argptr + 11, NULL, NULL);
./setopt.c:788:82: warning: Longer than 79 columns (LONGLINE)
           Curl_cookie_add(data, data->cookies, FALSE, FALSE, argptr, NULL, NULL);
lib/cookie.c
@@ -819,7 +820,7 @@ Curl_cookie_add(struct Curl_easy *data,
the same domain and path as this */
/* at first, remove expired cookies */
- remove_expired(c);
+ if(!noexpire) remove_expired(c);

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Mar 31, 2018

Member

Nit: we put the conditional block on a new line below the if() line, never on the same!

@bagder

bagder Mar 31, 2018

Member

Nit: we put the conditional block on a new line below the if() line, never on the same!

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 2, 2018

Member

Thanks!

Member

bagder commented Apr 2, 2018

Thanks!

@bagder bagder closed this in 4073cd8 Apr 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment