From: minima Date: Wed, 23 Feb 2005 16:11:09 +0000 (+0000) Subject: fix before_send logic X-Git-Tag: R_1_52~156 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b9f0846b89c35dd6d92dcca815f49af1682924d;p=spider.git fix before_send logic --- diff --git a/perl/AMsg.pm b/perl/AMsg.pm index 4ca43cb4..4738403a 100644 --- a/perl/AMsg.pm +++ b/perl/AMsg.pm @@ -126,7 +126,6 @@ sub new_client { $conn->{outbound} = 0; $conn->{state} = 'WH'; # wait for return authorize my $thing = $conn->{lastthing} = Thingy::Hello->new(); - $thing->send($conn, 'Aranea'); dbg("-> D $conn->{peerhost} $thing->{Aranea}") if isdbg('chan'); } diff --git a/perl/Thingy.pm b/perl/Thingy.pm index 308e80c3..10f20f28 100644 --- a/perl/Thingy.pm +++ b/perl/Thingy.pm @@ -74,7 +74,9 @@ sub send # before send (and line generation) things # function must return true to make the send happen $sub = "before_send_$class"; - return unless $thing->can($sub) && $thing->$sub($dxchan); + if ($thing->can($sub)) { + return $thing->$sub($dxchan); + } # generate the protocol line which may (or not) be cached my $ref;