projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix type in Changes
[spider.git]
/
cmd
/
connect.pl
diff --git
a/cmd/connect.pl
b/cmd/connect.pl
index ed6ba9a07a8286dbfd622bc7397af452be741df1..b3b001819b5067fe49bd0fceeff728f36f7f6cba 100644
(file)
--- a/
cmd/connect.pl
+++ b/
cmd/connect.pl
@@
-5,9
+5,10
@@
my $self = shift;
my $call = uc shift;
my $lccall = lc $call;
my $call = uc shift;
my $lccall = lc $call;
-return (
0) if $self->priv < 8
;
+return (
1, $self->msg('e5')) if $self->priv < 5
;
return (1, $self->msg('e6')) unless $call gt ' ';
return (1, $self->msg('already', $call)) if DXChannel->get($call);
return (1, $self->msg('e6')) unless $call gt ' ';
return (1, $self->msg('already', $call)) if DXChannel->get($call);
+return (1, $self->msg('outconn', $call)) if grep {$_->{call} eq $call} @main::outstanding_connects;
return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall";
my $prog = "$main::root/local/client.pl";
return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall";
my $prog = "$main::root/local/client.pl";
@@
-18,11
+19,16
@@
if (defined $pid) {
if (!$pid) {
# in child, unset warnings, disable debugging and general clean up from us
$^W = 0;
if (!$pid) {
# in child, unset warnings, disable debugging and general clean up from us
$^W = 0;
+ $SIG{HUP} = 'IGNORE';
eval "{ package DB; sub DB {} }";
alarm(0);
eval "{ package DB; sub DB {} }";
alarm(0);
+ DXChannel::closeall();
+ Msg::close_server();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
exec $prog, $call, 'connect';
} else {
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
exec $prog, $call, 'connect';
} else {
+ sleep(1); # do a coordination
+ push @main::outstanding_connects, {call => $call, pid => $pid};
return(1, $self->msg('constart', $call));
}
}
return(1, $self->msg('constart', $call));
}
}