diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/hdata.txt | 1 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/hdata.txt | 1 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/hdata.txt | 1 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/hdata.txt | 1 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/hdata.txt | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 16 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.h | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-upgrade.c | 1 |
9 files changed, 18 insertions, 9 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.4.1-dev, 2013-02-14 +v0.4.1-dev, 2013-02-16 Version 0.4.1 (under dev!) @@ -22,6 +22,8 @@ Version 0.4.1 (under dev!) * aspell: add info "aspell_dict" (dictionaries used on a buffer) * aspell: optimization on spellers to improve speed (save state by buffer) * guile: fix compilation with guile 2.0 +* irc: fix memory leak in purge of hashtables with joins (it was done only for + the first server in the list) * irc: add color in output of /names when result is on server buffer (channel not joined) (bug #38070) * perl: simplify code to load scripts diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt index 5ae96233b..f05e485cf 100644 --- a/doc/de/autogen/plugin_api/hdata.txt +++ b/doc/de/autogen/plugin_api/hdata.txt @@ -185,6 +185,7 @@ 'cmd_list_regexp' (pointer) + 'last_user_message' (time) + 'last_away_check' (time) + + 'last_data_purge' (time) + 'outqueue' (pointer) + 'last_outqueue' (pointer) + 'redirects' (pointer, hdata: "irc_redirect") + diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt index 8ce90af62..ba73ebae1 100644 --- a/doc/en/autogen/plugin_api/hdata.txt +++ b/doc/en/autogen/plugin_api/hdata.txt @@ -185,6 +185,7 @@ 'cmd_list_regexp' (pointer) + 'last_user_message' (time) + 'last_away_check' (time) + + 'last_data_purge' (time) + 'outqueue' (pointer) + 'last_outqueue' (pointer) + 'redirects' (pointer, hdata: "irc_redirect") + diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt index bfd61b683..a56613426 100644 --- a/doc/fr/autogen/plugin_api/hdata.txt +++ b/doc/fr/autogen/plugin_api/hdata.txt @@ -185,6 +185,7 @@ 'cmd_list_regexp' (pointer) + 'last_user_message' (time) + 'last_away_check' (time) + + 'last_data_purge' (time) + 'outqueue' (pointer) + 'last_outqueue' (pointer) + 'redirects' (pointer, hdata: "irc_redirect") + diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt index 25c1bf333..bb2792e94 100644 --- a/doc/it/autogen/plugin_api/hdata.txt +++ b/doc/it/autogen/plugin_api/hdata.txt @@ -185,6 +185,7 @@ 'cmd_list_regexp' (pointer) + 'last_user_message' (time) + 'last_away_check' (time) + + 'last_data_purge' (time) + 'outqueue' (pointer) + 'last_outqueue' (pointer) + 'redirects' (pointer, hdata: "irc_redirect") + diff --git a/doc/ja/autogen/plugin_api/hdata.txt b/doc/ja/autogen/plugin_api/hdata.txt index 06a665911..f594fc30d 100644 --- a/doc/ja/autogen/plugin_api/hdata.txt +++ b/doc/ja/autogen/plugin_api/hdata.txt @@ -185,6 +185,7 @@ 'cmd_list_regexp' (pointer) + 'last_user_message' (time) + 'last_away_check' (time) + + 'last_data_purge' (time) + 'outqueue' (pointer) + 'last_outqueue' (pointer) + 'redirects' (pointer, hdata: "irc_redirect") + diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index cd0c20b9c..ff80397bf 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -105,8 +105,6 @@ char *irc_server_chanmodes_default = "beI,k,l"; const char *irc_server_send_default_tags = NULL; /* default tags when */ /* sending a message */ -time_t irc_server_last_check_join_channels = 0; - void irc_server_reconnect (struct t_irc_server *server); void irc_server_free_data (struct t_irc_server *server); @@ -949,6 +947,7 @@ irc_server_alloc (const char *name) new_server->cmd_list_regexp = NULL; new_server->last_user_message = 0; new_server->last_away_check = 0; + new_server->last_data_purge = 0; for (i = 0; i < IRC_SERVER_NUM_OUTQUEUES_PRIO; i++) { new_server->outqueue[i] = NULL; @@ -2831,11 +2830,8 @@ irc_server_timer_cb (void *data, int remaining_calls) ptr_redirect = ptr_next_redirect; } - /* - * remove old channels in "join_manual" and "join_noswitch" - * (every 5 minutes) - */ - if (current_time > irc_server_last_check_join_channels + (60 * 5)) + /* purge some data (every 10 minutes) */ + if (current_time > ptr_server->last_data_purge + (60 * 10)) { weechat_hashtable_map (ptr_server->join_manual, &irc_server_check_join_manual_cb, @@ -2843,7 +2839,7 @@ irc_server_timer_cb (void *data, int remaining_calls) weechat_hashtable_map (ptr_server->join_noswitch, &irc_server_check_join_noswitch_cb, ptr_server); - irc_server_last_check_join_channels = current_time; + ptr_server->last_data_purge = current_time; } } } @@ -4525,6 +4521,7 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name) WEECHAT_HDATA_VAR(struct t_irc_server, cmd_list_regexp, POINTER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, last_user_message, TIME, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, last_away_check, TIME, 0, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_irc_server, last_data_purge, TIME, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, outqueue, POINTER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, last_outqueue, POINTER, 0, NULL, NULL); WEECHAT_HDATA_VAR(struct t_irc_server, redirects, POINTER, 0, NULL, "irc_redirect"); @@ -4745,6 +4742,8 @@ irc_server_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_time (ptr_item, "last_away_check", server->last_away_check)) return 0; + if (!weechat_infolist_new_var_time (ptr_item, "last_data_purge", server->last_data_purge)) + return 0; return 1; } @@ -5052,6 +5051,7 @@ irc_server_print_log () weechat_log_printf (" cmd_list_regexp. . . : 0x%lx", ptr_server->cmd_list_regexp); weechat_log_printf (" last_user_message. . : %ld", ptr_server->last_user_message); weechat_log_printf (" last_away_check. . . : %ld", ptr_server->last_away_check); + weechat_log_printf (" last_data_purge. . . : %ld", ptr_server->last_data_purge); for (i = 0; i < IRC_SERVER_NUM_OUTQUEUES_PRIO; i++) { weechat_log_printf (" outqueue[%02d] . . . . : 0x%lx", i, ptr_server->outqueue[i]); diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h index 4a9438b63..cb1124dfe 100644 --- a/src/plugins/irc/irc-server.h +++ b/src/plugins/irc/irc-server.h @@ -194,6 +194,7 @@ struct t_irc_server regex_t *cmd_list_regexp; /* compiled Regular Expression for /list */ time_t last_user_message; /* time of last user message (anti flood)*/ time_t last_away_check; /* time of last away check on server */ + time_t last_data_purge; /* time of last purge (some hashtables) */ struct t_irc_outqueue *outqueue[2]; /* queue for outgoing messages */ /* with 2 priorities (high/low) */ struct t_irc_outqueue *last_outqueue[2]; /* last outgoing message */ diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c index da99dbc96..e262c88de 100644 --- a/src/plugins/irc/irc-upgrade.c +++ b/src/plugins/irc/irc-upgrade.c @@ -418,6 +418,7 @@ irc_upgrade_read_cb (void *data, irc_upgrade_current_server->lag_last_refresh = weechat_infolist_time (infolist, "lag_last_refresh"); irc_upgrade_current_server->last_user_message = weechat_infolist_time (infolist, "last_user_message"); irc_upgrade_current_server->last_away_check = weechat_infolist_time (infolist, "last_away_check"); + irc_upgrade_current_server->last_data_purge = weechat_infolist_time (infolist, "last_data_purge"); } break; case IRC_UPGRADE_TYPE_CHANNEL: |