Subject: | accept ignores class name |
Date: | Fri, 12 Apr 2013 00:23:58 +0200 (CEST) |
To: | bug-IO-Socket-IP [...] rt.cpan.org |
From: | Pavel Kankovsky <kan [...] dcit.cz> |
Distribution name and version: IO-Socket-IP-0.19
Perl version: 5.10.1
Operating System vendor and version: CentOS 6
Problem: accept method does not pass the optional class name to the
superclass. This breaks any code depending on a new incoming connection
being blessed in a given class. A notable example is any recent version of
IO::Socket::SSL that dies with "Not a HASH reference" at a seemingly
unrelated point in accept_SSL because it mistakes the new socket for an
argument hash.
The following change appears to fix the bug:
---snip---
--- IO/Socket/IP.pm.old 2013-03-12 02:35:39.000000000 +0100
+++ IO/Socket/IP.pm 2013-04-11 23:52:41.682713871 +0200
@@ -795,7 +795,7 @@
sub accept
{
my $self = shift;
- my ( $new, $peer ) = $self->SUPER::accept or return;
+ my ( $new, $peer ) = $self->SUPER::accept(@_) or return;
${*$new}{$_} = ${*$self}{$_} for qw( io_socket_domain io_socket_type io_socket_proto );
---snip---
--
Pavel Kankovsky