1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Bug 887: save_cookies ignores cookies_dirty if requested by the user.

This commit is contained in:
Kalle Olavi Niemitalo 2006-12-09 18:23:41 +02:00 committed by Kalle Olavi Niemitalo
parent 47a2fc19e1
commit 7551be3194
3 changed files with 10 additions and 6 deletions

View File

@ -802,7 +802,7 @@ static void
resave_cookies_bottom_half(void *always_null)
{
if (get_cookies_save() && get_cookies_resave())
save_cookies(); /* checks cookies_dirty */
save_cookies(0); /* checks cookies_dirty */
}
/* Note that the cookies have been modified, and register a bottom
@ -822,14 +822,18 @@ set_cookies_dirty(void)
register_bottom_half(resave_cookies_bottom_half, NULL);
}
/* @interactive is 1 if the user told ELinks to save cookies, or 0 if
* ELinks decided that on its own. In the latter case, this function
* does not save the cookies if it thinks the file is already up to
* date. */
void
save_cookies(void) {
save_cookies(int interactive) {
struct cookie *c;
unsigned char *cookfile;
struct secure_save_info *ssi;
time_t now;
if (cookies_nosave || !elinks_home || !cookies_dirty
if (cookies_nosave || !elinks_home || !(cookies_dirty || interactive)
|| get_cmd_opt_bool("anonymous"))
return;
@ -880,7 +884,7 @@ done_cookies(struct module *module)
free_list(c_domains);
if (!cookies_nosave && get_cookies_save())
save_cookies();
save_cookies(0);
free_cookies_list(&cookies);
free_cookies_list(&cookie_queries);

View File

@ -44,7 +44,7 @@ void done_cookie(struct cookie *);
void delete_cookie(struct cookie *);
void set_cookie(struct uri *, unsigned char *);
void load_cookies(void);
void save_cookies(void);
void save_cookies(int interactive);
void set_cookies_dirty(void);
/* Note that the returned value points to a static structure and thus the

View File

@ -465,7 +465,7 @@ push_add_server_button(struct dialog_data *dlg_data, struct widget_data *button)
static widget_handler_status_T
push_save_button(struct dialog_data *dlg_data, struct widget_data *button)
{
save_cookies();
save_cookies(1);
return EVENT_PROCESSED;
}