fix warning in PoCo-Client/Server-TCP, thanks HMBRAND
Apocalypse
14 years ago
0 | 0 |
Revision history for Perl extension POE::Component::SSLify.
|
|
1 |
|
|
2 |
* 0.19
|
|
3 |
|
|
4 |
Fixed a warning generated by POE::Component::Client::TCP in t/simple.t, thanks HMBRAND!
|
1 | 5 |
|
2 | 6 |
* 0.18
|
3 | 7 |
|
2 | 2 |
|
3 | 3 |
# Initialize our version
|
4 | 4 |
use vars qw( $VERSION );
|
5 | |
$VERSION = '0.18';
|
|
5 |
$VERSION = '0.19';
|
6 | 6 |
|
7 | 7 |
# Import the SSL death routines
|
8 | 8 |
use Net::SSLeay qw( die_now die_if_ssl_error );
|
2 | 2 |
|
3 | 3 |
# Initialize our version
|
4 | 4 |
use vars qw( $VERSION );
|
5 | |
$VERSION = '0.18';
|
|
5 |
$VERSION = '0.19';
|
6 | 6 |
|
7 | 7 |
# Import the SSL death routines
|
8 | 8 |
use Net::SSLeay qw( die_now die_if_ssl_error );
|
2 | 2 |
|
3 | 3 |
# Initialize our version
|
4 | 4 |
use vars qw( $VERSION );
|
5 | |
$VERSION = '0.18';
|
|
5 |
$VERSION = '0.19';
|
6 | 6 |
|
7 | 7 |
# We need Net::SSLeay or all's a failure!
|
8 | 8 |
BEGIN {
|
|
57 | 57 |
# Perl 5.005_03 doesn't like blocking(), so we only use it in
|
58 | 58 |
# 5.8.0 and beyond.
|
59 | 59 |
if ( $] >= 5.008 and $^O eq 'MSWin32' ) {
|
|
60 |
# TODO investigate this?
|
|
61 |
# <kmx> kthakore: Apocalypse: FYI - as regards no-blocking socket dark magic commited to FB while ago - IO::Socket 1.24 (=May/2009) and later supports on Win32 simply $socket->blocking(0);
|
|
62 |
# <Apocalypse> kmx: Ah didn't know that - maybe I can use that :)
|
|
63 |
# <kmx> Apocalypse: I uderstand that used workaround is from pre IO::Socket 1.24 times
|
|
64 |
# <Apocalypse> Ah, my code already did that eh
|
|
65 |
# <Apocalypse> if ( $] >= 5.008 and $^O eq 'MSWin32' ) {
|
|
66 |
# <Apocalypse> But maybe 5.008 check isn't enough?
|
|
67 |
# <kmx> Apocalypse: You'd better check version of IO - see changelog http://cpansearch.perl.org/src/GBARR/IO-1.25/ChangeLog
|
|
68 |
# <Apocalypse> Hmm yeah
|
|
69 |
# <Apocalypse> * Make non-blocking mode work on Windows in IO::Socket::INET
|
|
70 |
# <kmx> Apocalypse: exactly
|
|
71 |
# <Apocalypse> Thanks for the tip! I'll go and add a TODO to the sslify code to investigate that :)
|
|
72 |
|
|
73 |
|
60 | 74 |
# From IO::Handle POD
|
61 | 75 |
# If an error occurs blocking will return undef and $! will be set.
|
62 | 76 |
if ( ! $socket->blocking( 0 ) ) {
|
1 | 1 |
use strict; use warnings;
|
2 | 2 |
|
3 | 3 |
use Test::More;
|
4 | |
eval "use Test::Apocalypse";
|
|
4 |
eval "use Test::Apocalypse 0.10";
|
5 | 5 |
if ( $@ ) {
|
6 | 6 |
plan skip_all => 'Test::Apocalypse required for validating the distribution';
|
7 | 7 |
} else {
|
8 | 8 |
# lousy hack for kwalitee
|
9 | 9 |
require Test::NoWarnings; require Test::Pod; require Test::Pod::Coverage;
|
10 | |
is_apocalypse_here( {
|
11 | |
deny => qr/^(?:(?:OutdatedPrereq|Dependencie)s|ModuleUsed|Strict|Fixme|Pod_Spelling)$/,
|
12 | |
} );
|
|
10 |
is_apocalypse_here();
|
13 | 11 |
}
|
82 | 82 |
$heap->{client}->put("pong2");
|
83 | 83 |
}
|
84 | 84 |
},
|
|
85 |
ClientError => sub
|
|
86 |
{
|
|
87 |
# Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
|
|
88 |
# The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
|
|
89 |
my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
|
|
90 |
|
|
91 |
# TODO are there other "errors" that is harmless?
|
|
92 |
$error = "Normal disconnection" unless $error;
|
|
93 |
my $msg = "Got SERVER $syscall error $errno: $error";
|
|
94 |
unless ( $syscall eq 'read' and $errno == 0 ) {
|
|
95 |
fail( $msg );
|
|
96 |
} else {
|
|
97 |
diag( $msg );
|
|
98 |
}
|
|
99 |
},
|
85 | 100 |
);
|
86 | 101 |
|
87 | 102 |
POE::Component::Client::TCP->new
|
|
147 | 162 |
$kernel->yield('shutdown');
|
148 | 163 |
}
|
149 | 164 |
},
|
|
165 |
ServerError => sub
|
|
166 |
{
|
|
167 |
# Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
|
|
168 |
# The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
|
|
169 |
my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
|
|
170 |
|
|
171 |
# TODO are there other "errors" that is harmless?
|
|
172 |
$error = "Normal disconnection" unless $error;
|
|
173 |
my $msg = "Got CLIENT $syscall error $errno: $error";
|
|
174 |
unless ( $syscall eq 'read' and $errno == 0 ) {
|
|
175 |
fail( $msg );
|
|
176 |
} else {
|
|
177 |
diag( $msg );
|
|
178 |
}
|
|
179 |
},
|
150 | 180 |
);
|
151 | 181 |
|
152 | 182 |
$poe_kernel->run();
|