Branch Coverage

blib/lib/Net/SC.pm
Criterion Covered Total %
branch 0 258 0.0


line true false branch
198 0 0 if (exists $def_conf{$_})
203 0 0 unless (exists $$self{"CFG_$key"})
212 0 0 unless (defined $self->configure('TIMEOUT'))
222 0 0 if ($self->configure('SYSLOG')) { }
0 0 elsif (defined $self->configure('LOG_FILE')) { }
223 0 0 if ($^O =~ /[Ww]in32/) { }
228 0 0 unless (defined $self->configure('LOG_FH'))
236 0 0 if ($^O ne 'solaris' and $^O ne 'freebsd' and eval { do { &Sys::Syslog::_PATH_LOG() } })
239 0 0 unless (defined setlogsock('unix'))
244 0 0 unless (defined openlog('sc45', 'cons,pid', 'daemon'))
252 0 0 if (open $key, '>>' . $self->configure('LOG_FILE')) { }
277 0 0 if (not exists $$self{'CFG_' . uc($section)}) { }
0 0 elsif (uc $section eq 'CHAIN_DATA' and (caller)[0] ne 'Net::SC') { }
286 0 0 if (scalar @_ > 2)
306 0 0 unless (defined $self->configure('CHAIN_DATA'))
307 0 0 unless (($rc = $self->read_chain_data) == SOCKS_OKAY())
310 0 0 if ($self->configure('AUTO_SAVE'))
317 0 0 if ($self->configure('AUTO_SAVE'))
337 0 0 unless (defined $self->configure('CHAIN_DATA'))
338 0 0 unless (($rc = $self->read_chain_data) == SOCKS_OKAY())
341 0 0 if ($self->configure('AUTO_SAVE'))
348 0 0 if ($self->configure('AUTO_SAVE'))
363 0 0 if ($self->socks_param('protocol_version') == 4) { }
0 0 elsif ($self->socks_param('protocol_version') == 5) { }
411 0 0 unless (defined $id)
414 0 0 if (not defined $id) { }
0 0 elsif (not defined $param) { }
0 0 elsif (not exists {addr => 1, addr_type => 9, attempt_cnt => 6, cd => 8, last_check_time => 7, listen_addr => 10, listen_port => 11, port => 2, prev_user_id => 12, protocol_version => 5, user_id => 3, user_pswd => 4}->{$param}) { }
0 0 elsif (defined $value) { }
0 0 elsif (not exists $self->configure('CHAIN_DATA')->[$id]{$param}) { }
435 0 0 if (defined $_[0]) { }
473 0 0 if (defined $self->configure('CHAIN_FILE_DATA') and ref $self->configure('CHAIN_FILE_DATA') eq 'ARRAY') { }
480 0 0 unless (open $sym, '<' . $self->configure('CHAIN_FILE'))
498 0 0 if $data[$line] =~ /^#/ or $data[$line] =~ /^\s*$/
503 0 0 unless (defined $socks_host and length $socks_host)
507 0 0 unless (defined $socks_port and $socks_port > 0)
511 0 0 unless (defined $socks_proto and length $socks_proto and $socks_proto == 4 || $socks_proto == 5 || $socks_proto == 0)
517 0 0 unless (defined $socks_user)
520 0 0 unless (defined $socks_pswd)
533 0 0 if (scalar @{$self->configure('CHAIN_DATA');}) { }
550 0 0 if (not defined $self->configure('CHAIN_DATA')) { }
570 0 0 unless (defined $self->configure('CHAIN_DATA') and defined $id)
571 0 0 if (not defined $id) { }
579 0 0 if ($status == SOCKS_OKAY()) { }
602 0 0 unless (defined $self->configure('CHAIN_DATA'))
606 0 0 unless (dbmopen %hash, $self->configure('CHAIN_FILE') . '-cache', 384)
614 0 0 unless (open $sym, '<' . $self->configure('CHAIN_FILE'))
628 0 0 unless (defined $hash{$key})
652 0 0 unless (defined $self->configure('CHAIN_DATA'))
656 0 0 unless (dbmopen %hash, $self->configure('CHAIN_FILE') . '-cache', 384)
663 0 0 if (scalar keys %hash == 0)
672 0 0 unless (open $sym, '<' . $self->configure('CHAIN_FILE'))
699 0 0 if (not exists $hash2{$key} and $self->configure('RESTORE_TYPE') == 1) { }
731 0 0 unless exists {addr => 1, addr_type => 9, attempt_cnt => 6, cd => 8, last_check_time => 7, listen_addr => 10, listen_port => 11, port => 2, prev_user_id => 12, protocol_version => 5, user_id => 3, user_pswd => 4}->{$key}
733 0 0 if (not defined $val) { }
759 0 0 if (not defined $self->configure('CHAIN_DATA')) { }
0 0 elsif (not defined $peer_host && defined $peer_port) { }
0 0 elsif (not defined $type or $type != 1 and $type != 2) { }
0 0 elsif ($self->configure('CHAIN_LEN') < 1) { }
0 0 elsif ($self->configure('RANDOM_CHAIN') > 0) { }
787 0 0 if (defined $self->sh)
791 0 0 if (scalar @hosts_id < $self->configure('CHAIN_LEN'))
800 0 0 unless ($self->first_connect == SOCKS_OKAY())
811 0 0 if $host_ind >= $self->configure('CHAIN_LEN') - 1
816 0 0 if ($self->socks_param('protocol_version') == 5 and $self->configure('LOOP_CONNECT') & 1) { }
0 0 elsif ($self->socks_param('protocol_version') == 0 and $self->configure('LOOP_CONNECT') & 4) { }
0 0 elsif ($self->socks_param('protocol_version') == 4 and $self->configure('LOOP_CONNECT') & 2) { }
835 0 0 unless ($rc == SOCKS_OKAY())
838 0 0 if ($self->configure('DEBUG') & 1)
841 0 0 if ($self->configure('DEBUG') & 8)
852 0 0 if ($self->socks_param('protocol_version') == 5) { }
0 0 elsif ($self->socks_param('protocol_version') == 0) { }
868 0 0 unless ($rc == SOCKS_OKAY())
869 0 0 if ($self->configure('DEBUG') & 1)
872 0 0 if ($self->configure('DEBUG') & 8)
881 0 0 if ($host_ind < $self->configure('CHAIN_LEN') - 1)
889 0 0 if ($self->socks_param('protocol_version') == 5) { }
0 0 elsif ($self->socks_param('protocol_version') == 0) { }
908 0 0 unless defined $Config::Config{'d_flock'}
923 0 0 if (ref $self and $self->configure('SYSLOG') and not $^O =~ /[Ww]in32/)
925 0 0 unless /^\s*$/
945 0 0 if (ref $self and $self->configure('SYSLOG') and not $^O =~ /[Ww]in32/) { }
0 0 elsif (ref $self and $self->configure('SYSLOG') and defined $self->configure('LOG_FH')) { }
950 0 0 unless /^\s*$/
969 0 0 if (not ref $self) { }
0 0 elsif (not defined($sym = $self->configure('LOG_FH'))) { }
977 0 0 unless /^\s*$/
996 0 0 if (defined $self->socks_param($_, undef, $id)) { }
1022 0 0 unless (defined $self->sh)
1048 0 0 unless (defined $cnt)
1057 0 0 if (ref $fh2 eq 'SCALAR') { }
1064 0 0 if $self->socks_param('protocol_version') == 0
1069 0 0 $is_http_proxy ? :
1070 0 0 unless (select $rin, undef, undef, $self->configure('TimeOut'))
1078 0 0 unless (select $rin, undef, undef, $self->configure('TimeOut'))
1087 0 0 unless (defined $rc)
1088 0 0 if ($@ eq "Read data - timeout\n") { }
1097 0 0 if ($_ < 1) { }
0 0 elsif (ref $fh2 eq 'SCALAR' and $self->configure('DEBUG') & 2) { }
1123 0 0 if (not defined $rc) { }
1127 0 0 if ($self->configure('DEBUG') & 4)
1150 0 0 if ($self->configure('DEBUG') & 1)
1179 0 0 if ($self->configure('DEBUG') & 1)
1186 0 0 unless ((my $rc = $self->socks5_auth) == SOCKS_OKAY())
1193 0 0 if ($peer_host =~ /[a-zA-Z]/) { }
1224 0 0 if ($self->configure('DEBUG') & 1)
1231 0 0 if ($req_num == 2)
1244 0 0 if (length $self->socks_param('user_id') > 0 and length $self->socks_param('user_pswd') > 0)
1273 0 0 if (length $self->socks_param('user_id') > 0 and length $self->socks_param('user_pswd') > 0)
1285 0 0 if (not $self->read_data($self->sh, \$received, 2) or length $received < 2)
1290 0 0 if ($ver != 5)
1293 0 0 if ($method == 255)
1296 0 0 if ($method == 2 and length $self->socks_param('user_id') == 0 || length $self->socks_param('user_pswd') == 0) { }
0 0 elsif ($method == 2) { }
1308 0 0 if (not $self->read_data($self->sh, \$received, 2) or length $received < 2)
1314 0 0 if ($status == 0) { }
1333 0 0 if (not $self->read_data($self->sh, \$received, 8) or length $received < 8)
1358 0 0 if (not $self->read_data($self->sh, \$received, 4) or length $received < 4)
1368 0 0 if ($self->socks_param('addr_type') == 3) { }
0 0 elsif ($self->socks_param('addr_type') == 1) { }
1369 0 0 if (not $self->read_data($self->sh, \$received, 1) or length $received < 1)
1373 0 0 if (not $self->read_data($self->sh, \$received, $length) or length $received < $length)
1376 0 0 unless ($received = gethostbyname $received)
1380 0 0 if (not $self->read_data($self->sh, \$received, 4) or length $received < 4)
1389 0 0 if (not $self->read_data($self->sh, \$received, 2) or length $received < 2)
1395 0 0 if ($self->socks_param('cd') == 0)
1413 0 0 if (not $self->read_data($self->sh, \$received, 0) or length $received < 5)
1419 0 0 if ($received =~ m[HTTP/\d+\.\d+\s+200]is) { }
0 0 elsif ($received =~ m[HTTP/\d+\.\d+\s+(\d+)\s+([^\r\n]+)]is) { }