projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add set/maxconnect command
[spider.git]
/
perl
/
cluster.pl
diff --git
a/perl/cluster.pl
b/perl/cluster.pl
index 46f4818325af00ef5945e48ac2027e58dbef3877..0bf306599d30ee09f7650f4f0ae04ca85c4170b4 100755
(executable)
--- a/
perl/cluster.pl
+++ b/
perl/cluster.pl
@@
-187,12
+187,15
@@
sub new_channel
# (fairly) politely disconnect people that are connected to too many other places at once
my $r = Route::get($call);
# (fairly) politely disconnect people that are connected to too many other places at once
my $r = Route::get($call);
- if ($r) {
+ if ($r
&& $user
) {
my @n = $r->parents;
my @n = $r->parents;
- my $v = $r->isa('Route::Node') ? $maxconnect_node : $maxconnect_user;
+ my $m = $r->isa('Route::Node') ? $maxconnect_node : $maxconnect_user;
+ my $c = $user->maxconnect;
+ my $v;
+ $v = defined $c ? $c : $m;
if ($v && @n >= $v) {
my $nodes = join ',', @n;
if ($v && @n >= $v) {
my $nodes = join ',', @n;
- LogDbg('DXCommand', "$call has too many connections ($v) at $nodes
,
disconnected");
+ LogDbg('DXCommand', "$call has too many connections ($v) at $nodes
-
disconnected");
already_conn($conn, $call, DXM::msg($lang, 'contomany', $call, $v, $nodes));
return;
}
already_conn($conn, $call, DXM::msg($lang, 'contomany', $call, $v, $nodes));
return;
}