File Coverage

blib/lib/IO/Socket/Socks/Wrapped.pm
Criterion Covered Total %
statement 19 23 82.6
branch n/a
condition n/a
subroutine 7 10 70.0
pod 0 4 0.0
total 26 37 70.2


line stmt bran cond sub pod time code
1             package IO::Socket::Socks::Wrapped;
2              
3 7     7   52 no warnings 'redefine';
  7         14  
  7         372  
4 7     7   40 use IO::Socket;
  7         7  
  7         63  
5 7     7   4180 use IO::Socket::Socks::Wrapper;
  7         14  
  7         79  
6              
7             our $VERSION = '0.15';
8             our $AUTOLOAD;
9              
10             sub new {
11 15     15 0 24 my ($class, $obj, $cfg) = @_;
12 15         54 bless {orig => $obj, cfg => $cfg}, $class;
13             }
14              
15             sub AUTOLOAD {
16 36     36   338726 my $self = shift;
17            
18 36         253 IO::Socket::Socks::Wrapper::_io_socket_connect_ref();
19            
20             local *IO::Socket::IP::connect = local *IO::Socket::connect = sub {
21 72     72   162784 return IO::Socket::Socks::Wrapper::_connect(@_, $self->{cfg}, 1);
22 36         1055 };
23            
24 36         345 $AUTOLOAD =~ s/^.+:://;
25 36         1000 $self->{orig}->$AUTOLOAD(@_);
26             }
27              
28             sub isa {
29 14     14 0 1195 my $self = shift;
30 14         163 $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     sub DESTROY {}
44              
45             1;
46              
47             __END__