tidy blocking for windows (possibly)
[spider.git] / perl / Msg.pm
index e13be8f31d90f00329ff08a628c66fa79ac5cffb..00128af622318d2a601de452c5a646de5a7f465d 100644 (file)
@@ -5,18 +5,14 @@
 #
 # I have modified it to suit my devious purposes (Dirk Koopman G1TLH)
 #
-# $Id$
+#
 #
 
 package Msg;
 
 use strict;
 
-use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+use DXUtil;
 
 use IO::Select;
 use IO::Socket;
@@ -70,8 +66,8 @@ BEGIN {
        # defines EINPROGRESS as 10035.  We provide it here because some
        # Win32 users report POSIX::EINPROGRESS is not vendor-supported.
        if ($^O eq 'MSWin32') { 
-               eval '*EINPROGRESS = sub { 10036 };';
-               eval '*EWOULDBLOCK = *EAGAIN = sub { 10035 };';
+               eval '*EINPROGRESS = sub { 10036 };' unless defined *EINPROGRESS;
+               eval '*EWOULDBLOCK = *EAGAIN = sub { 10035 };' unless defined *EWOULDBLOCK;
                eval '*F_GETFL     = sub {     0 };';
                eval '*F_SETFL     = sub {     0 };';
                eval '*IPPROTO_TCP     = sub {     6 };';
@@ -491,10 +487,10 @@ sub _rcv {                     # Complement to _send
     return unless defined($sock);
 
        my @lines;
-       if ($conn->{blocking}) {
-               blocking($sock, 0);
-               $conn->{blocking} = 0;
-       }
+#      if ($conn->{blocking}) {
+#              blocking($sock, 0);
+#              $conn->{blocking} = 0;
+#      }
        $bytes_read = sysread ($sock, $msg, 1024, 0);
        if (defined ($bytes_read)) {
                if ($bytes_read > 0) {