From bf70bfa143fc397220ad7a4f7bb0c1febcad4412 Mon Sep 17 00:00:00 2001 From: djmcgrath Date: Sun, 28 Oct 2007 18:37:30 +0000 Subject: [PATCH] * Fix NULL chan being created in %channels * Updated BUGS list git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1595 c11ca15a-4712-0410-83d8-924469b57eb5 --- BUGS | 2 -- src/IRC/Schedulers.pl | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/BUGS b/BUGS index e7c0944..dc4baea 100644 --- a/BUGS +++ b/BUGS @@ -4,7 +4,5 @@ Known bugs that should be dealt with soon as possible: * !+topic list gives and incorrect error Failed. "You (#botpark) are not in #botpark, hey?" * Bot tries to ask chanserv for OP's on any channel. Should be a chanset setting on a per channel basis * News is currently stored in a file rather than the SQL table created for it - * bot doesnt seem to keep track of stat counters for "heh :) ...etc". Might be settings though and not a bug * !help has size issues. Add's extra lines with only 1 or 2 help commands instead of one maximum size IRC msg - * FIXME: !WARN! ircCheck: we have a NULL chan in hash channels? removing! * Bot can be flooded offline with a crash if !+factstats help and /msg nick factstats help, are used at the same time diff --git a/src/IRC/Schedulers.pl b/src/IRC/Schedulers.pl index fbf99bd..2e6bc8f 100644 --- a/src/IRC/Schedulers.pl +++ b/src/IRC/Schedulers.pl @@ -489,9 +489,10 @@ sub netsplitCheck { } # yet another hack. - foreach (keys %channels) { - my $i = $cache{maxpeeps}{$chan} || 0; - my $j = scalar(keys %{ $channels{$chan} }); + # FIXED: $ch should be used rather than $chan since it creates NULL channels in the hash + foreach my $ch (keys %channels) { + my $i = $cache{maxpeeps}{$ch} || 0; + my $j = scalar(keys %{ $channels{$ch} }); next unless ($i > 10 and 0.25*$i > $j); &DEBUG("netsplit: 0.25*max($i) > current($j); possible netsplit?"); -- 2.39.2