Branch Coverage

blib/lib/LightTCP/SSLclient.pm
Criterion Covered Total %
branch 48 222 21.6


line true false branch
65 0 2 if ($proxy =~ /^\[(.+)\]:(\d+)$/)
69 0 2 if ($proxy =~ /^([^:]+):(\d+)$/)
73 0 2 if ($proxy =~ /^([^:]+)$/)
82 0 0 unless defined $str
104 0 0 unless (defined $res)
106 0 0 if $!{'EAGAIN'} or $!{'EWOULDBLOCK'}
109 0 0 if $res == 0
115 0 0 if ($@)
119 0 0 if ($$buffer_ref =~ /^([^\Q$delim\E]*)\Q$delim\E(.*)$/s)
137 0 0 unless defined $read and $read > 0
143 0 0 if ($@)
162 1 1 if $self->{'verbose'}
179 0 2 if ($self->{'insecure'}) { }
185 0 0 if ($self->{'cert'} and -f $self->{'cert'} . '.key' and -f $self->{'cert'} . '.crt')
190 1 1 if ($self->{'verbose'})
193 0 7 if $k =~ /SSL_(key|cert)_file/
198 2 0 if ($proxy) { }
200 2 0 unless ($proxy_host and $proxy_port)
205 0 0 if $self->{'verbose'}
212 0 0 unless ($socket)
219 0 0 if ($proxy_auth)
222 0 0 if $self->{'verbose'}
228 0 0 unless ($proxy_resp)
230 0 0 if $socket
234 0 0 unless ($proxy_resp =~ m[^HTTP/1\.[01]\s+200\b]i)
235 0 0 if $socket
239 0 0 if $self->{'verbose'}
241 0 0 if ('IO::Socket::SSL'->start_SSL($socket, %ssl_opts)) { }
243 0 0 if $self->{'verbose'}
252 0 0 if $self->{'verbose'}
258 0 0 if ($socket) { }
260 0 0 if $self->{'verbose'}
273 0 0 unless $self->{'_target_host'} and $self->{'_target_port'}
291 1 2 if $self->{'verbose'}
292 1 2 if $self->{'verbose'}
294 3 0 unless ($socket)
303 0 0 defined $payload ? :
308 0 0 $self->{'keep_alive'} ? :
317 0 0 unless (print $socket "$method $path HTTP/1.1\r\n")
322 0 0 if ($send_ok)
323 0 0 if $self->{'verbose'}
328 0 0 if $self->{'verbose'}
329 0 0 unless (print $socket "${key}: $val\r\n")
337 0 0 if ($send_ok and $length > 0)
338 0 0 unless (print $socket "Content-Length: $length\r\n")
344 0 0 if ($send_ok)
345 0 0 unless (print $socket "\r\n")
351 0 0 if ($send_ok and defined $payload and $length > 0)
352 0 0 unless (print $socket $payload)
360 0 0 if ($@)
365 0 0 unless ($send_ok)
386 0 0 if $req_errors
387 0 0 if $req_debug
388 0 0 unless $ok
391 0 0 if $resp_errors
392 0 0 if $resp_debug
393 0 0 unless $code
395 0 0 if ($self->{'follow_redirects'} and $code >= 300 and $code < 400 and $headers and $headers->{'location'})
396 0 0 if $self->{'_redirect_count'} >= $self->{'max_redirects'}
411 0 0 if $self->{'verbose'}
427 0 0 if ($uri->scheme) { }
0 0 elsif ($location =~ m[^/]) { }
428 0 0 if ($uri->scheme ne "https")
433 0 0 if ($uri->port and $uri->port != 443)
445 0 0 if ($location =~ m[^HTTP/1\.[01] (30[1278])\b]i)
447 0 0 if ($code eq 301 or $code eq 302)
448 0 0 if ($method eq "POST")
461 0 3 if $relative =~ m[^/]
464 0 3 unless length $current_path
467 3 0 unless $result =~ m[/$]
484 1 2 if $self->{'verbose'}
486 3 0 unless ($socket)
501 0 0 if $headers_raw =~ /\r\n\r\n|\n\n/
505 0 0 if ($@)
510 0 0 unless ($headers_raw =~ m[^HTTP/1\.[01]\s+(\d{3})\s+(.*?)\r?\n]i)
516 0 0 if $self->{'verbose'}
518 0 0 $headers_raw =~ /^(.*?)\r\n\r\n(.*)$/s ? :
528 0 0 if ($line =~ /^\s+(.+)/) { }
0 0 elsif ($line =~ /^([^:]+):\s*(.*)/) { }
529 0 0 if $current_key
538 0 0 $hdr{'content-length'} ? :
540 0 0 if ($chunked) { }
0 0 elsif (defined $content_length and $content_length > length $body) { }
562 0 0 $remaining > $buf_size ? :
563 0 0 unless defined $read and $read > 0
569 0 0 if ($@)
590 0 0 if ($@)
610 0 0 unless defined $chunk_line and length $chunk_line
614 0 0 if $self->{'verbose'}
616 0 0 if $chunk_size == 0
621 0 0 $need > $buf_size ? :
622 0 0 unless (defined $read and $read > 0)
631 0 0 unless ($trailing eq "\r\n" or $trailing eq "\n")
637 0 0 if ($@)
647 2 3 unless -f $file
649 0 3 unless open my $fh, "<", $file
652 3 0 if defined $fp
653 3 0 if defined $fp
659 4 4 $save ? :
663 2 6 unless -d $dir
664 2 6 unless (open my $fh, ">", $file)
670 2 4 if $self->{'verbose'}
671 2 4 if ($save)
672 0 2 if -f "$file.new"
680 1 30 if $self->{'_connected'}
695 0 3 if ($self->{'_socket'})
713 0 1 if $self->{'_socket'}
719 1 1 $insecure ? :
725 2 0 $keep_alive ? :
781 1 1 defined $size && $size > 0 ? :
803 0 1 $follow ? :