Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 61201
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: clkao [...] clkao.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Fwd: [PATCH] Fix IO::Socket::SSL constructor.
Date: Thu, 9 Sep 2010 21:19:40 +0800
To: bug-Net-Server [...] rt.cpan.org
From: Chia-liang Kao <clkao [...] clkao.org>
Show quoted text
---------- Forwarded message ---------- From: Chia-liang Kao <clkao@clkao.org> Date: 2 September 2010 20:21 Subject: [PATCH] Fix IO::Socket::SSL constructor. To: bug-Net-Server@rt.cpan.org Cc: Chia-liang Kao <clkao@clkao.org> The SSL_* aren't mutators and are dispatched to Proto::SSL's AUTOLOAD cause invocations of unknown methods. ---  lib/Net/Server/Proto/SSL.pm |   12 ++++++------  1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Net/Server/Proto/SSL.pm b/lib/Net/Server/Proto/SSL.pm index b39b2ea..7b3abc8 100644 --- a/lib/Net/Server/Proto/SSL.pm +++ b/lib/Net/Server/Proto/SSL.pm @@ -69,16 +69,16 @@ sub object {   $args{$_} = \$prop->{$_} for @ssl_args;   $server->configure(\%args); -  my $sock = $class->new; +  my $sock = $class->new( +      map { my $val = defined($prop->{$_}) ? $prop->{$_} +                    : $server->can($_)     ? $server->$_($host, $port, 'SSL') +                    :                        undef; +            $val ? ($_ => $val) : () } @ssl_args ); +;   $sock->NS_host($host);   $sock->NS_port($port);   $sock->NS_proto('SSL'); -  for my $key (@ssl_args) { -    my $val = defined($prop->{$key}) ? $prop->{$key} : $server->can($key) ? $server->$key($host, $port, 'SSL') : undef; -    $sock->$key($val); -  } -   return $sock;  } -- 1.7.0.3.254.g4503b
Subject: [PATCH] Fix IO::Socket::SSL constructor.
On Thu Sep 09 09:19:57 2010, clkao@clkao.org wrote: Show quoted text
> The SSL_* aren't mutators and are dispatched to Proto::SSL's AUTOLOAD > cause invocations of unknown methods.
I couldn't get clkao's patch to work. I made another... worksforme, -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
Subject: fix-test-server-Net-Server-0.99.patch
diff --git a/usr/local/share/perl/5.10.1/Net/Server/Proto/SSL.pm b/usr/local/share/perl/5.10.1/Net/Server/Proto/SSL.pm.jet index b39b2ea..45dc282 100644 --- a/usr/local/share/perl/5.10.1/Net/Server/Proto/SSL.pm +++ b/usr/local/share/perl/5.10.1/Net/Server/Proto/SSL.pm.jet @@ -76,7 +76,12 @@ sub object { for my $key (@ssl_args) { my $val = defined($prop->{$key}) ? $prop->{$key} : $server->can($key) ? $server->$key($host, $port, 'SSL') : undef; - $sock->$key($val); + if( $sock->can($key) ) { + $sock->$key($val); + + } else { + $sock->{$key} = $val; + } } return $sock;
On Fri Oct 29 09:24:39 2010, JETTERO wrote: Show quoted text
> worksforme,
Heh. I lied. Typically $sock isn't a hashref, so my else {} doesn't work at all. Please disregard the else of my patch and then it works for me. -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
The code is updated as of the just released version 2.000. The new version still uses the items as mutators - and they need to be to get passed from the configuration to the connection - but they are re-read in and passed as a hashref to the actual method doing the work. On the plus side, IO::Socket::SSL seems to be working well. Thanks for the report. Paul