X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=inline;f=perl%2FAGWMsg.pm;h=76b80fde344ef5601c97df9df3f5837e1d744575;hb=7c7080ad7019d6e23a8ad401256122e81fa03a5a;hp=4d1068ff35707ca813b03d5ad2dbf86d7da07705;hpb=1a704d7335183775146b29a32973961a4b799f87;p=spider.git diff --git a/perl/AGWMsg.pm b/perl/AGWMsg.pm index 4d1068ff..76b80fde 100644 --- a/perl/AGWMsg.pm +++ b/perl/AGWMsg.pm @@ -46,13 +46,16 @@ $hpolltime = 300 unless defined $hpolltime; %circuit = (); $total_in = $total_out = 0; $lastconnect = 0; -$connectinterval = 60; +$connectinterval = 30; sub init { return unless $enable; - $rproc = shift; + # only set $rproc if there is something to set rproc from! + my $rp = shift; + $rproc = $rp if defined $rp; + finish(); dbg("AGW initialising and connecting to $addr/$port ..."); @@ -406,6 +409,13 @@ sub _find return $circuit{$call}; } +sub peerhost +{ + my $conn = shift; + $conn->{peerhost} ||= $conn->{agwcall} || "UNKNOWN"; + return $conn->{peerhost}; +} + sub connect { my ($conn, $line) = @_;