X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FAGWMsg.pm;h=910d32cc4c94c50c1f75b023f1666014fcfcb352;hb=856cb98bb0f72ea86ea13c3e91d93aee7796fe9f;hp=c167d994a883eb7d0433495b512d03582679060d;hpb=8655b1a19d9458c7e0d185859a876740e3cda6ad;p=spider.git diff --git a/perl/AGWMsg.pm b/perl/AGWMsg.pm index c167d994..910d32cc 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 ..."); @@ -125,6 +128,8 @@ sub _sendf my $pid = shift || 0; my $data = shift || ''; my $len = 0; + + return unless $sock; $len = length $data; if ($sort eq 'y' || $sort eq 'H') { @@ -404,6 +409,13 @@ sub _find return $circuit{$call}; } +sub peerhost +{ + my $conn = shift; + $conn->{peerhost} ||= 'ax25'; + return $conn->{peerhost}; +} + sub connect { my ($conn, $line) = @_;