Branch Coverage

blib/lib/IO/Socket/Socks/Wrapper.pm
Criterion Covered Total %
branch 44 96 45.8


line true false branch
20 147 21 if $io_socket_connect
26 0 0 unless pipe my $blocking_reader, my $blocking_writer
37 0 0 if ($total_writed > 2097152)
52 0 0 if select undef, $win, undef, 0
59 0 4 if (@_ == 1 and not ref $_[0] and $_[0] eq 'wrap_connection')
64 4 33 unless (defined $cfg)
69 33 4 if ($pkg) { }
73 5 28 if ($pkg =~ /^(.+)::([^:]+)\(\)$/)
82 2 31 unless (delete $cfg->{'_norequire'} or %{$pkg . '::';})
83 0 2 unless eval "require $pkg"
87 5 28 if ($sub) { }
23 5 elsif ($pkg->isa('IO::Socket')) { }
93 2 3 exists $PKGS{$symbol} ? :
115 0 21 eval { do { *{$symbol;}{'CODE'} } } ? :
2 21 exists $PKGS{$pkg} ? :
126 0 42 if ($pkg_connect) { }
136 42 43 if ($parent->isa('IO::Socket'))
140 22 20 $connected ? :
159 2 19 unless (ref $socket)
186 6 95 if ($socket->isa('IO::Socket::Socks') or not $cfg or $connected = defined getpeername $socket)
187 13 85 unless (not $connected and $io_socket and do { *$socket }->{'io_socket_timeout'})
197 95 0 if (($port, $host) = eval { do { unpack_sockaddr_in($name) } }) { }
209 40 55 unless ($io_handler or exists $cfg->{'Timeout'})
215 0 95 if ($io_handler) { }
5 90 elsif (not $socket->blocking) { }
222 0 0 unless open my $tmp_socket, '+<&=' . $tmp_fd
244 95 0 if $ref and not $io_handler
254 5 90 if ($need_nb)
259 46 49 unless $ok
261 0 49 if ($io_handler)
266 0 0 unless ($done)
270 0 0 if ($io_handler->{'destroy_io_watcher'})
297 0 0 if ($socket->ready) { }
0 0 elsif ($IO::Socket::Socks::SOCKS_ERROR == &IO::Socket::Socks::SOCKS_WANT_WRITE) { }
0 0 elsif ($IO::Socket::Socks::SOCKS_ERROR != &IO::Socket::Socks::SOCKS_WANT_READ) { }
300 0 0 if ($io_handler->{'destroy_io_watcher'})
313 0 0 if ($io_handler->{'destroy_io_watcher'})
322 0 0 if ($socket->ready) { }
0 0 elsif ($IO::Socket::Socks::SOCKS_ERROR == &IO::Socket::Socks::SOCKS_WANT_READ) { }
0 0 elsif ($IO::Socket::Socks::SOCKS_ERROR != &IO::Socket::Socks::SOCKS_WANT_WRITE) { }
325 0 0 if ($io_handler->{'destroy_io_watcher'})
338 0 0 if ($io_handler->{'destroy_io_watcher'})
346 0 0 if ($io_handler->{'init_io_watcher'})
366 0 0 unless open my $self, '+<&=' . fileno($orig_handle)
378 0 0 if (@_)
387 0 0 @_ > 2 ? :
392 0 0 @_ > 2 ? :
403 0 0 unless ($self->handshake_done)