add some linger debugging
[spider.git] / perl / Msg.pm
index 15dc26d4ff29fe85e0b56ec665655babb284c256..746878e26e3c0df1288781e5420b35a1fec18be6 100644 (file)
@@ -359,7 +359,16 @@ sub new_server {
 sub nolinger
 {
        my $conn = shift;
+       my $buf;
+       if (isdbg('sock') && ($buf = getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER))) {
+               my ($l, $t) = unpack("ll", $buf);
+               dbg("Linger is: $buf = $l $t");
+       }
        setsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER, pack("ll", 0, 0)) or confess "setsockopt: $!";
+       if (isdbg('sock') && ($buf = getsockopt($conn->{sock}, SOL_SOCKET, SO_LINGER))) {
+               my ($l, $t) = unpack("ll", $buf);
+               dbg("Linger is: $buf = $l $t");
+       }
 }
 
 sub dequeue