Subject: | connect() never times out |
Due to `sub Net::HTTPS::blocking {}' always returning false, the
connect() in Net::SSL never times out. The attached patch fixes the problem.
Subject: | pts-net-ssl-connect-blocking.patch |
--- Net/SSL.pm.orig 2007-04-16 13:11:15.000000000 +0200
+++ Net/SSL.pm 2007-04-16 13:10:45.000000000 +0200
@@ -91,20 +91,21 @@
if ($self->proxy) {
# don't die() in connect, just return undef and set $@
my $proxy_connect = eval { $self->proxy_connect_helper(@_); };
if(! $proxy_connect || $@) {
$@ = "proxy connect failed: $@; $!";
die $@;
}
} else {
*$self->{io_socket_peername}=@_ == 1 ? $_[0] : IO::Socket::sockaddr_in(@_);
+ local *Net::HTTPS::blocking; #### pts #### Dat: otherwise `sub Net::HTTPS::blocking { }' would prevent the proper timeout
if(!$self->SUPER::connect(@_)) {
# better to die than return here
$@ = "Connect failed: $@; $!";
die $@;
}
}
# print "ssl_version ".*$self->{ssl_version}."\n";
my $debug = *$self->{'ssl_debug'} || 0;
my $ssl = Crypt::SSLeay::Conn->new(*$self->{'ssl_ctx'}, $debug, $self);