summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-netsplit.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2018-01-20 19:58:05 -0300
committerdequis <dx@dxzone.com.ar>2018-01-28 23:06:26 -0300
commita4f99ae746efb121185fe76c392a64d743a9eb92 (patch)
treed30d8178d1472f75fbde6a30927d910315e4e9f0 /src/fe-common/irc/fe-netsplit.c
parent243ae4be84d422322f20be1b715dc0b00ef9c32d (diff)
downloadirssi-a4f99ae746efb121185fe76c392a64d743a9eb92.zip
Revert more of the netsplit print optimisation to fix crashes
Now iterating over all servers to avoid crashes on server_ischannel(), which is a macro for server->ischannel(), so it dies horribly when it's null. Doesn't help that IS_IRC_SERVER() always returns true on null.
Diffstat (limited to 'src/fe-common/irc/fe-netsplit.c')
-rw-r--r--src/fe-common/irc/fe-netsplit.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/fe-common/irc/fe-netsplit.c b/src/fe-common/irc/fe-netsplit.c
index ac3330e5..edd3fc34 100644
--- a/src/fe-common/irc/fe-netsplit.c
+++ b/src/fe-common/irc/fe-netsplit.c
@@ -247,20 +247,17 @@ static int check_server_splits(IRC_SERVER_REC *server)
message before it. */
static void sig_print_starting(TEXT_DEST_REC *dest)
{
- IRC_SERVER_REC *rec;
+ GSList *tmp;
if (printing_splits)
return;
- if (!IS_IRC_SERVER(dest->server))
- return;
-
- if (!server_ischannel(dest->server, dest->target))
- return;
+ for (tmp = servers; tmp != NULL; tmp = tmp->next) {
+ IRC_SERVER_REC *rec = tmp->data;
- rec = IRC_SERVER(dest->server);
- if (rec->split_servers != NULL)
- print_splits(rec, NULL);
+ if (IS_IRC_SERVER(rec) && rec->split_servers != NULL)
+ print_splits(rec, NULL);
+ }
}
static int sig_check_splits(void)