File Coverage

blib/lib/IO/Socket/Socks/Wrapped.pm
Criterion Covered Total %
statement 19 24 79.1
branch n/a
condition n/a
subroutine 7 10 70.0
pod 0 4 0.0
total 26 38 68.4


line stmt bran cond sub pod time code
1             package IO::Socket::Socks::Wrapped;
2              
3 7     7   85 no warnings 'redefine';
  7         8  
  7         553  
4 7     7   32 use IO::Socket;
  7         55  
  7         53  
5 7     7   6112 use IO::Socket::Socks::Wrapper;
  7         14  
  7         168  
6              
7             our $VERSION = '0.14';
8             our $AUTOLOAD;
9              
10             sub new {
11 15     15 0 28 my ($class, $obj, $cfg) = @_;
12 15         85 bless {orig => $obj, cfg => $cfg}, $class;
13             }
14              
15             sub AUTOLOAD {
16 36     36   564418 my $self = shift;
17            
18 36         379 IO::Socket::Socks::Wrapper::_io_socket_connect_ref();
19            
20             local *IO::Socket::IP::connect = local *IO::Socket::connect = sub {
21 72     72   246180 return IO::Socket::Socks::Wrapper::_connect(@_, $self->{cfg}, 1);
22 36         958 };
23            
24 36         568 $AUTOLOAD =~ s/^.+:://;
25 36         1301 $self->{orig}->$AUTOLOAD(@_);
26             }
27              
28             sub isa {
29 14     14 0 1496 my $self = shift;
30 14         432 $self->{orig}->isa(@_);
31             }
32              
33             sub can {
34 0     0 0   my $self = shift;
35 0           $self->{orig}->can(@_);
36             }
37              
38             sub DOES {
39 0     0 0   my $self = shift;
40 0           $self->{orig}->DOES(@_);
41             }
42              
43 0     0     sub DESTROY {}
44              
45             1;
46              
47             __END__