r70464 - in /trunk/libio-multiplex-perl: Changes MANIFEST META.yml debian/changelog debian/control lib/IO/Multiplex.pm t/110_ntest.t t/200_udp.t

carnil at users.alioth.debian.org carnil at users.alioth.debian.org
Sat Mar 5 15:10:40 UTC 2011


Author: carnil
Date: Sat Mar  5 15:10:18 2011
New Revision: 70464

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=70464
Log:
* New upstream release
* Add myself to Uploaders.

Modified:
    trunk/libio-multiplex-perl/Changes
    trunk/libio-multiplex-perl/MANIFEST
    trunk/libio-multiplex-perl/META.yml
    trunk/libio-multiplex-perl/debian/changelog
    trunk/libio-multiplex-perl/debian/control
    trunk/libio-multiplex-perl/lib/IO/Multiplex.pm
    trunk/libio-multiplex-perl/t/110_ntest.t
    trunk/libio-multiplex-perl/t/200_udp.t

Modified: trunk/libio-multiplex-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/Changes?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/Changes (original)
+++ trunk/libio-multiplex-perl/Changes Sat Mar  5 15:10:18 2011
@@ -1,4 +1,20 @@
 Revision history for Perl extension IO::Multiplex.
+
+1.12 Wed Feb 23 22:35:27 CET 2011
+	- fix MSWin32 complaints
+	  rt.cpan.org#66096 [Mark Dootson]
+
+1.11 Wed Feb  2 17:05:08 CET 2011
+        - Avoid warning while adding pipe
+          rt.cpan.org#60068 [Khedin] and #16259
+	- Add EWOULDBLOCK and non-blocking mode for windows,
+	  rt.cpan.org#23982 [junk at penilecolada.com]
+	- Typo "closeing", rt.cpan.org#21085 [D Steinbrunner]
+	- avoid shutdown after close,
+	  rt.cpan.org#5715 [Lars Jensen] and #5885
+	- use length of outbuf, not exists to see if it is
+	  empty. [Ersun Warncke]
+	- turn "use warnings" on
 
 1.10  Mon Sep 15 2008
 	- Update Copyright and License.

Modified: trunk/libio-multiplex-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/MANIFEST?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/MANIFEST (original)
+++ trunk/libio-multiplex-perl/MANIFEST Sat Mar  5 15:10:18 2011
@@ -1,12 +1,12 @@
 Changes
+MANIFEST
+META.yml
+Makefile.PL
 README
 TODO
-MANIFEST
-Makefile.PL
+contrib/portfw
 lib/IO/Multiplex.pm
-contrib/portfw
 t/100_load.t
+t/110_ntest.t
 t/110_test.t
-t/110_ntest.t
 t/200_udp.t
-META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libio-multiplex-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/META.yml?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/META.yml (original)
+++ trunk/libio-multiplex-perl/META.yml Sat Mar  5 15:10:18 2011
@@ -1,11 +1,21 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         IO-Multiplex
-version:      1.10
-version_from: lib/IO/Multiplex.pm
-installdirs:  site
+--- #YAML:1.0
+name:               IO-Multiplex
+version:            1.12
+abstract:           Manage IO on many file handles
+author:  []
+license:            unknown
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
 requires:
-    IO::Socket:                    0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+    IO::Socket:  0
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libio-multiplex-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/debian/changelog?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/debian/changelog (original)
+++ trunk/libio-multiplex-perl/debian/changelog Sat Mar  5 15:10:18 2011
@@ -1,4 +1,4 @@
-libio-multiplex-perl (1.10-2) UNRELEASED; urgency=low
+libio-multiplex-perl (1.12-1) UNRELEASED; urgency=low
 
   [ gregor herrmann ]
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
@@ -14,7 +14,11 @@
   [ Ansgar Burchardt ]
   * Update my email address.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:43:57 +0100
+  [ Salvatore Bonaccorso ]
+  * New upstream release
+  * Add myself to Uploaders.
+
+ -- Salvatore Bonaccorso <carnil at debian.org>  Sat, 05 Mar 2011 16:09:21 +0100
 
 libio-multiplex-perl (1.10-1) unstable; urgency=low
 

Modified: trunk/libio-multiplex-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/debian/control?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/debian/control (original)
+++ trunk/libio-multiplex-perl/debian/control Sat Mar  5 15:10:18 2011
@@ -5,7 +5,8 @@
 Build-Depends-Indep: perl (>= 5.8), netbase
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: gregor herrmann <gregoa at debian.org>,
- Ansgar Burchardt <ansgar at debian.org>
+ Ansgar Burchardt <ansgar at debian.org>,
+ Salvatore Bonaccorso <carnil at debian.org>
 Standards-Version: 3.8.0
 Homepage: http://search.cpan.org/dist/IO-Multiplex/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libio-multiplex-perl/

Modified: trunk/libio-multiplex-perl/lib/IO/Multiplex.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/lib/IO/Multiplex.pm?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/lib/IO/Multiplex.pm (original)
+++ trunk/libio-multiplex-perl/lib/IO/Multiplex.pm Sat Mar  5 15:10:18 2011
@@ -1,4 +1,9 @@
 package IO::Multiplex;
+
+use strict;
+use warnings;
+
+our $VERSION = '1.12';
 
 =head1 NAME
 
@@ -15,13 +20,11 @@
   $mux->listen($server_socket);
   $mux->loop;
 
-  sub mux_input {
-    ...
-  }
+  sub mux_input { ... }
 
 C<IO::Multiplex> is designed to take the effort out of managing
-multiple file handles.  It is essentially a really fancy front end to
-the C<select> system call.  In addition to maintaining the C<select>
+multiple file handles. It is essentially a really fancy front end to
+the C<select> system call. In addition to maintaining the C<select>
 loop, it buffers all input and output to/from the file handles.  It
 can also accept incoming connections on one or more listen sockets.
 
@@ -261,28 +264,29 @@
 
 =cut
 
-use strict;
 use POSIX qw(errno_h BUFSIZ);
-use vars qw($VERSION);
 use Socket;
 use FileHandle qw(autoflush);
 use IO::Handle;
 use Fcntl;
 use Carp qw(carp);
-use constant IsWin => ($^O =~ /Win32/i);
-
-$VERSION = '1.10';
+use constant IsWin => ($^O eq 'MSWin32');
+
 
 BEGIN {
     eval {
         # Can optionally use Hi Res timers if available
         require Time::HiRes;
-        Time::HiRes->import ('time');
-    }
-};
+        Time::HiRes->import('time');
+    };
+}
 
 # This is what you want.  Trust me.
 $SIG{PIPE} = 'IGNORE';
+
+{   no warnings;
+    if(IsWin) { *EWOULDBLOCK = sub() {10035} }
+}
 
 =head2 new
 
@@ -326,6 +330,7 @@
 
     $self->add($fh);
     $self->{_fhs}{"$fh"}{listen} = 1;
+    $fh;
 }
 
 =head2 add
@@ -349,8 +354,11 @@
     nonblock($fh);
     autoflush($fh, 1);
     fd_set($self->{_readers}, $fh, 1);
-    $self->{_fhs}{"$fh"}{udp_true} =
-        (SOCK_DGRAM == unpack("i", scalar getsockopt($fh,Socket::SOL_SOCKET(),Socket::SO_TYPE())));
+
+    my $sockopt = getsockopt $fh, SOL_SOCKET, SO_TYPE;
+    $self->{_fhs}{"$fh"}{udp_true} = 1
+        if defined $sockopt && SOCK_DGRAM == unpack "i", $sockopt;
+
     $self->{_fhs}{"$fh"}{inbuffer} = '';
     $self->{_fhs}{"$fh"}{outbuffer} = '';
     $self->{_fhs}{"$fh"}{fileno} = fileno($fh);
@@ -666,12 +674,12 @@
                             if $obj && $obj->can("mux_eof");
 
                         if (exists $self->{_fhs}{"$fh"}) {
-                            delete $self->{_fhs}{"$fh"}{inbuffer};
+                            $self->{_fhs}{"$fh"}{inbuffer} = '';
                             # The mux_eof handler could have responded
                             # with a shutdown for writing.
                             $self->close($fh)
-                                unless exists $self->{_fhs}{"$fh"} &&
-                                    exists $self->{_fhs}{"$fh"}{outbuffer};
+                                unless exists $self->{_fhs}{"$fh"}
+                                    && length $self->{_fhs}{"$fh"}{outbuffer};
                         }
                         next;
                     }
@@ -708,19 +716,20 @@
                     next;
                 }
                 substr($self->{_fhs}{"$fh"}{outbuffer}, 0, $rv) = '';
-                unless ($self->{_fhs}{"$fh"}{outbuffer}) {
+                unless (length $self->{_fhs}{"$fh"}{outbuffer}) {
                     # Mark us as not writable if there's nothing more to
                     # write
                     fd_set($self->{_writers}, $fh, 0);
                     $obj->mux_outbuffer_empty($self, $fh)
                         if ($obj && $obj->can("mux_outbuffer_empty"));
 
-                    if ($self->{_fhs}{"$fh"}{shutdown}) {
+                    if (   $self->{_fhs}{"$fh"}
+                        && $self->{_fhs}{"$fh"}{shutdown}) {
                         # If we've been marked for shutdown after write
                         # do it.
                         shutdown($fh, 1);
-                        delete $self->{_fhs}{"$fh"}{outbuffer};
-                        unless (exists $self->{_fhs}{"$fh"}{inbuffer}) {
+                        $self->{_fhs}{"$fh"}{outbuffer} = '';
+                        unless (length $self->{_fhs}{"$fh"}{inbuffer}) {
                             # We'd previously been shutdown for reading
                             # also, so close out completely
                             $self->close($fh);
@@ -879,16 +888,16 @@
     if ($which == 1 || $which == 2) {
         # Shutdown for writing.  Only do this now if there is no pending
         # data.
-        if ($self->{_fhs}{"$fh"}{outbuffer}) {
+        if(length $self->{_fhs}{"$fh"}{outbuffer}) {
             $self->{_fhs}{"$fh"}{shutdown} = 1;
         } else {
             shutdown($fh, 1);
-            delete $self->{_fhs}{"$fh"}{outbuffer};
+            $self->{_fhs}{"$fh"}{outbuffer} = '';
         }
     }
     # Delete the descriptor if it's totally gone.
-    unless (exists $self->{_fhs}{"$fh"}{inbuffer} ||
-            exists $self->{_fhs}{"$fh"}{outbuffer}) {
+    unless (length $self->{_fhs}{"$fh"}{inbuffer} ||
+            length $self->{_fhs}{"$fh"}{outbuffer}) {
         $self->close($fh);
     }
 }
@@ -909,8 +918,8 @@
     return unless exists $self->{_fhs}{"$fh"};
 
     my $obj = $self->{_fhs}{"$fh"}{object} || $self->{_object};
-    warn "closeing with read buffer" if $self->{_fhs}{"$fh"}{inbuffer};
-    warn "closeing with write buffer" if $self->{_fhs}{"$fh"}{outbuffer};
+    warn "closing with read buffer"  if length $self->{_fhs}{"$fh"}{inbuffer};
+    warn "closing with write buffer" if length $self->{_fhs}{"$fh"}{outbuffer};
 
     fd_set($self->{_readers}, $fh, 0);
     fd_set($self->{_writers}, $fh, 0);
@@ -928,13 +937,17 @@
 # get a partial write in those circumstances, which is what we want.
 
 sub nonblock
-{
-    return 1 if IsWin;
-    my $fh = shift;
-    my $flags = fcntl($fh, F_GETFL, 0)
-        or die "fcntl F_GETFL: $!\n";
-    fcntl($fh, F_SETFL, $flags | O_NONBLOCK)
-        or die "fcntl F_SETFL $!\n";
+{   my $fh = shift;
+
+    if(IsWin)
+    {   ioctl($fh, 0x8004667e, pack("L!", 1));
+    }
+    else
+    {   my $flags = fcntl($fh, F_GETFL, 0)
+            or die "fcntl F_GETFL: $!\n";
+        fcntl($fh, F_SETFL, $flags | O_NONBLOCK)
+            or die "fcntl F_SETFL $!\n";
+    }
 }
 
 sub fd_set

Modified: trunk/libio-multiplex-perl/t/110_ntest.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/t/110_ntest.t?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/t/110_ntest.t (original)
+++ trunk/libio-multiplex-perl/t/110_ntest.t Sat Mar  5 15:10:18 2011
@@ -58,10 +58,16 @@
 print "ok 10\n";
 
 my $flags = 0;
-fcntl($server_socket, F_GETFL, $flags)
-    or die "fcntl F_GETFL: $!\n";
-fcntl($server_socket, F_SETFL, $flags & ~O_NONBLOCK)
-    or die "fcntl F_SETFL $!\n";
+
+if($^O eq 'MSWin32')
+{   ioctl($server_socket, 0x8004667e, pack("L!", 0));
+}
+else
+{   fcntl($server_socket, F_GETFL, $flags)
+        or die "fcntl F_GETFL: $!\n";
+    fcntl($server_socket, F_SETFL, $flags & ~O_NONBLOCK)
+        or die "fcntl F_SETFL $!\n";
+}
 
 if (syswrite ($client_socket, $test_msg1, length $test_msg1) == 10) {
     print "ok 11\n";

Modified: trunk/libio-multiplex-perl/t/200_udp.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libio-multiplex-perl/t/200_udp.t?rev=70464&op=diff
==============================================================================
--- trunk/libio-multiplex-perl/t/200_udp.t (original)
+++ trunk/libio-multiplex-perl/t/200_udp.t Sat Mar  5 15:10:18 2011
@@ -19,6 +19,11 @@
 use IO::Socket;
 use IO::Multiplex;
 use POSIX qw(ENOTCONN EDESTADDRREQ);
+
+if($^O eq 'MSWin32')
+{   no warnings;
+    *ENOTCONN = sub() {10057};
+}
 
 $| = 1;
 plan tests => 15;




More information about the Pkg-perl-cvs-commits mailing list