Skip to content

Commit eab481d

Browse files
committed
6.96: solved an issue where some users may not be ->quit()ted during netsplit due to modification of the {users} array during iteration.
1 parent 09464c4 commit eab481d

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

INDEV

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,4 +1915,6 @@ CHANGES:
19151915
94. use server mode string for ->fire_command() in JOIN user command handler.
19161916

19171917
95. handle modes from the local server rather than the user in Access module.
1918+
1919+
96. solved an issue where some users may not be ->quit()ted during netsplit due to modification of the {users} array during iteration.
19181920

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.95
1+
6.96

lib/channel/mine.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sub localjoin {
3030
}
3131

3232
names($channel, $user);
33-
$user->handle("TOPIC $$channel{name}") if exists $channel->{topic};
33+
$user->handle("TOPIC $$channel{name}") if $channel->{topic};
3434
$user->numeric('RPL_ENDOFNAMES', $channel->{name});
3535

3636
# fire after join event.

lib/pool.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ sub delete_user {
191191

192192
# remove from server.
193193
# this isn't a very efficient way to do this.
194-
@{ $user->{server}{users} } = grep { $_ != $user} @{ $user->{server}{users} };
194+
my $users = $user->{server}{users};
195+
@$users = grep { $_ != $user } @$users;
195196

196197
# forget it.
197198
delete $user->{pool};

lib/server.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sub new {
2222

2323
sub quit {
2424
my ($server, $reason, $why) = @_;
25-
$why //= $server->{name}.q( ).$server->{parent}->{name};
25+
$why //= $server->{name}.q( ).$server->{parent}{name};
2626

2727
log2("server $$server{name} has quit: $reason");
2828

@@ -33,7 +33,8 @@ sub quit {
3333
}
3434

3535
# delete all of the server's users.
36-
foreach my $user (@{ $server->{users} }) {
36+
my @users = @{ $server->{users} };
37+
foreach my $user (@users) {
3738
$user->quit($why);
3839
}
3940

0 commit comments

Comments
 (0)