X-Git-Url: http://scm.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=c9b58a482cb19398d9e94cc3cf471e3f69bb801d;hb=e1d5c2a325cb6b8674eab55c23f12445aae01f52;hp=850842810f034af6b7147ec3d94d8e5da7cb6d73;hpb=dc888bd77fad283e988528b3fca9933605c134dd;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index 85084281..c9b58a48 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -84,8 +84,8 @@ BEGIN { eval '*EWOULDBLOCK = *EAGAIN = sub { 10035 };' unless defined *EWOULDBLOCK; eval '*F_GETFL = sub { 0 };' unless defined *F_GETFL; eval '*F_SETFL = sub { 0 };' unless defined *F_SETFL; - eval 'sub IPPROTO_TCP { 6 };' unless defined *IPPROTO_TCP; - eval 'sub TCP_NODELAY { 1 };' unless defined *TCP_NODELAY; + eval 'sub IPPROTO_TCP { 6 };'; + eval 'sub TCP_NODELAY { 1 };'; $blocking_supported = 0; # it appears that this DOESN'T work :-( } } @@ -193,6 +193,12 @@ sub pid_gone } } +sub peerhost +{ + my $self = shift; + return $self->{peerhost}; +} + #----------------------------------------------------------------- # Send side routines sub connect { @@ -225,7 +231,8 @@ sub connect { return undef unless $r || _err_will_block($!); $conn->{sock} = $sock; - + $conn->{peerhost} = $sock->peerhost; # for consistency + if ($conn->{rproc}) { my $callback = sub {$conn->_rcv}; set_event_handler ($sock, read => $callback);