X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FMsg.pm;h=5aef961ee4f4162593228d0c1abd71a41dd52fef;hb=7505989c04f2d3ff01ca126407c1dcd17e4bc62b;hp=c9ad34338952888b03fa4c563bae15cef172c993;hpb=7b96c0d932ac9f34cbbaf97b8299ed8d0b47e598;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index c9ad3433..5aef961e 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -52,6 +52,18 @@ BEGIN { eval { require Errno; Errno->import(qw(EAGAIN EINPROGRESS EWOULDBLOCK)); }; + + unless ($^O eq 'MSWin32') { + if ($] >= 5.6) { + eval { + require Socket; Socket->import(qw(IPPROTO_TCP TCP_NODELAY)); + }; + } else { + dbg("IPPROTO_TCP and TCP_NODELAY manually defined"); + eval 'sub IPPROTO_TCP { 6 };'; + eval 'sub TCP_NODELAY { 1 };'; + } + } # http://support.microsoft.com/support/kb/articles/Q150/5/37.asp # defines EINPROGRESS as 10035. We provide it here because some # Win32 users report POSIX::EINPROGRESS is not vendor-supported. @@ -375,11 +387,6 @@ sub new_server { return $self; } -eval "use Socket qw(IPPROTO_TCP TCP_NODELAY)"; -if ($@ && !$main::is_win) { - sub IPPROTO_TCP {6;} - sub TCP_NODELAY {1;}; -} sub nolinger {