X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=531bff7336fb969f19cf581f9d7b5f41f24c4a7d;hb=5167e718e090d2869a02cdba98760c069a8948c3;hp=850842810f034af6b7147ec3d94d8e5da7cb6d73;hpb=dc888bd77fad283e988528b3fca9933605c134dd;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index 85084281..531bff73 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,16 @@ sub pid_gone } } +sub peerhost +{ + my $self = shift; + my $ip; + unless ($self->{peerhost}) { + $self->{peerhost} = $self->{sock}->peerhost; + } + return $self->{peerhost}; +} + #----------------------------------------------------------------- # Send side routines sub connect { @@ -225,7 +235,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);