]> dxcluster.org Git - spider.git/commitdiff
remove all set sockopts for M$
authorminima <minima>
Fri, 11 Jan 2002 18:08:04 +0000 (18:08 +0000)
committerminima <minima>
Fri, 11 Jan 2002 18:08:04 +0000 (18:08 +0000)
perl/Msg.pm

index 8cf36701ef78d61852d78ee9c612dab6982707f5..e774c59d41ddb6df20c610e2ef886a14d7e6c2f1 100644 (file)
@@ -394,24 +394,24 @@ sub nolinger
 {
        my $conn = shift;
 
-       if (isdbg('sock')) {
-               my ($l, $t) = unpack "ll", getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER); 
-               my $k = unpack 'l', getsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE);
-               my $n = $main::is_win ? 0 : unpack "l", getsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY);
-               dbg("Linger is: $l $t, keepalive: $k, nagle: $n");
-       }
-               
-       setsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE, 1) or confess "setsockopt keepalive: $!";
        unless ($main::is_win) {
+               if (isdbg('sock')) {
+                       my ($l, $t) = unpack "ll", getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER); 
+                       my $k = unpack 'l', getsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE);
+                       my $n = $main::is_win ? 0 : unpack "l", getsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY);
+                       dbg("Linger is: $l $t, keepalive: $k, nagle: $n");
+               }
+               
+               setsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE, 1) or confess "setsockopt keepalive: $!";
                setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt linger: $!";
                setsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY, 1) or confess "setsockopt: $!";
-       }               
-       if (isdbg('sock')) {
-               my ($l, $t) = unpack "ll", getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER); 
-               my $k = unpack 'l', getsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE);
-               my $n = $main::is_win ? 0 : unpack "l", getsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY);
-               dbg("Linger is: $l $t, keepalive: $k, nagle: $n");
-         
+
+               if (isdbg('sock')) {
+                       my ($l, $t) = unpack "ll", getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER); 
+                       my $k = unpack 'l', getsockopt($conn->{sock}, SOL_SOCKET, SO_KEEPALIVE);
+                       my $n = $main::is_win ? 0 : unpack "l", getsockopt($conn->{sock}, IPPROTO_TCP, TCP_NODELAY);
+                       dbg("Linger is: $l $t, keepalive: $k, nagle: $n");
+               }
        } 
        $conn->{sock}->autoflush(0);
 }