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