]> dxcluster.net Git - spider.git/commitdiff
try to get around differences for TCP_NODELAY for perl 5_005 and below
authorminima <minima>
Fri, 11 Jan 2002 00:30:15 +0000 (00:30 +0000)
committerminima <minima>
Fri, 11 Jan 2002 00:30:15 +0000 (00:30 +0000)
perl/Msg.pm

index 5593e937b0323218bbc89bbcfe66a086f266ef41..57880ed112f825f9d445a4bdf7397375f4ac0835 100644 (file)
@@ -375,7 +375,11 @@ sub new_server {
        return $self;
 }
 
-use Socket qw(IPPROTO_TCP TCP_NODELAY);
+eval "use Socket qw(IPPROTO_TCP TCP_NODELAY)";
+if ($@) {
+       sub IPPROTO_TCP {6;}
+       sub TCP_NODELAY {1;};
+}
 
 sub nolinger
 {
@@ -390,7 +394,7 @@ sub nolinger
 
        setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt linger: $!";
        setsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE, 1) or confess "setsockopt keepalive: $!";
-       setsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY, 1) or confess "setsockopt: $!";
+       setsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY, 1) or confess "setsockopt: $!" unless $main::iswin;
        $conn->{sock}->autoflush(0);
        
        if (isdbg('sock')) {