Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

clbr
Copy link
Contributor

@clbr 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
Copy link
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 Outdated
@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bagder
Copy link
Member

bagder commented Apr 2, 2018

Thanks!

@bagder bagder closed this in 4073cd8 Apr 2, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants