Browse Source

Small improvement attemps.

themage
Marco Neves 9 years ago
parent
commit
6b6324fadc
2 changed files with 5 additions and 4 deletions
  1. 1 1
      bin/avidmq-cons.pl
  2. 4 3
      lib/AvidMQ/Server.pm

+ 1 - 1
bin/avidmq-cons.pl

@ -68,4 +68,4 @@ EOS
68 68
		print STDERR "\n\n";
69 69
		$statstime=time()+10;
70 70
	}
71
}
71
}

+ 4 - 3
lib/AvidMQ/Server.pm

@ -470,8 +470,9 @@ sub broadcast {
470 470
	if ($broadid) {
471 471
		my $bmsg=$self->{_broad_messages}->{$broadid};
472 472
		if ($bmsg->{subscribers} and @{$bmsg->{subscribers}}) {
473
			my $sub=shift @{$bmsg->{subscribers}};
474
			$self->_send_to($bmsg->{message}, $sub);
473
			while (my $sub=shift @{$bmsg->{subscribers}}) {
474
				$self->_send_to($bmsg->{message}, $sub);
475
			}
475 476
		}
476 477
		unless ($bmsg->{subscribers} and @{$bmsg->{subscribers}}) {
477 478
			shift @{$self->{_broad_queue}}; #trash it
@ -564,4 +565,4 @@ sub _ok_msg {
564 565
	return { type => 'ok' };
565 566
}
566 567
567
1;
568
1;