From 4fec4b52841eaca3a43003df8f979ac098bb367d Mon Sep 17 00:00:00 2001 From: Mitchell Cooper Date: Wed, 5 Mar 2014 23:43:36 -0500 Subject: [PATCH] 6.99: fixed a few bugs in server burst. --- INDEV | 6 ++++++ VERSION | 2 +- lib/server/mine.pm | 12 ++++++++---- modules/Core.module/submodules/ServerCommands.pm | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/INDEV b/INDEV index 11203c28..401cebb2 100644 --- a/INDEV +++ b/INDEV @@ -1922,5 +1922,11 @@ CHANGES: added ->do_mode_string_local() which is the same as ->do_mode_string() except it doesn't tell other servers about the change. 98. not sure why but topic information was sent awkwardly between names list and RPL_ENDOF_NAMES. + + 99. fixed a few bugs in server burst. + + + + diff --git a/VERSION b/VERSION index 2c6318b0..1fc1f0b6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.98 \ No newline at end of file +6.99 \ No newline at end of file diff --git a/lib/server/mine.pm b/lib/server/mine.pm index e790a8cb..7197ff85 100644 --- a/lib/server/mine.pm +++ b/lib/server/mine.pm @@ -84,9 +84,10 @@ sub send_burst { # first, send modes of this server. fire_command($server, aum => v('SERVER')); fire_command($server, acm => v('SERVER')); - - $done{$server} = 1; - $done{v('SERVER')} = 1; + + # don't send info for this server or the server we're sending to. + $done{$server} = 1; + $done{ v('SERVER') } = 1; $do = sub { my $serv = shift; @@ -94,6 +95,9 @@ sub send_burst { # already did this one. return if $done{$serv}; + # we learned about this server from the server we're sending to. + return if defined $serv->{source} && $serv->{source} == $server; + # we need to do the parent first. if (!$done{$serv->{parent}} && $serv->{parent} != $serv) { $do->($serv->{parent}); @@ -114,7 +118,7 @@ sub send_burst { foreach my $user ($main::pool->users) { # ignore users the server already knows! - next if $user->{server} == $server || $server->{sid} == $user->{source}; + next if $user->{server} == $server || $user->{source} == $server; fire_command($server, uid => $user); diff --git a/modules/Core.module/submodules/ServerCommands.pm b/modules/Core.module/submodules/ServerCommands.pm index 61335657..01504836 100644 --- a/modules/Core.module/submodules/ServerCommands.pm +++ b/modules/Core.module/submodules/ServerCommands.pm @@ -168,7 +168,7 @@ sub sid { my $ref = {}; $ref->{$_} = shift @args foreach qw[parent sid time name proto ircd desc]; - $ref->{source} = $server->{sid}; # source = SID we learned about the server from + $ref->{source} = $server; # source = server we learned about the server from # do not allow SID or server name collisions if ($main::pool->lookup_server($ref->{sid}) || $main::pool->lookup_server_name($ref->{name})) { @@ -189,7 +189,7 @@ sub uid { my $ref = {}; $ref->{$_} = shift @args foreach qw[server uid time modes nick ident host cloak ip real]; - $ref->{source} = $server->{sid}; # source = SID we learned about the user from + $ref->{source} = $server; # source = server we learned about the user from $ref->{location} = $server; my $modestr = delete $ref->{modes}; # location = the server through which this server can access the user.