line |
true |
false |
branch |
31
|
0 |
11 |
if ($slash_path) |
32
|
0 |
0 |
if $other == $self |
68
|
3 |
14 |
unless (defined $source) |
74
|
3 |
11 |
unless ($obj{'_uri'}->scheme eq "gemini") |
81
|
3 |
8 |
if (length $yuri > 1024) |
96
|
0 |
5 |
if ($depth != 0) |
97
|
0 |
0 |
if $param{'tofu'} |
112
|
0 |
8 |
$param{'tofu'} ? : |
|
8 |
0 |
exists $param{'ssl'} ? : |
|
0 |
5 |
unless $obj{'_socket'} = "IO::Socket::SSL"->new("SSL_hostname", $obj{'_host'}, $param{'tofu'} ? ("SSL_verifycn_scheme", "none") : (), "SSL_verify_callback", sub {
my($ok, $ctx_store, $certname, $error, $cert, $depth) = @_;
if ($depth != 0) {
return 1 if $param{'tofu'};
return $ok;
};
($param{'verify_ssl'} || \&Net::Gemini::_verify_ssl)->(@obj{"_host", "_port"}, &Net::SSLeay::X509_get_fingerprint($cert, "sha256"), &Net::SSLeay::P_ASN1_TIME_get_isotime(scalar &Net::SSLeay::X509_get_notBefore($cert)), &Net::SSLeay::P_ASN1_TIME_get_isotime(scalar &Net::SSLeay::X509_get_notAfter($cert)), $ok, $cert);
}
, exists $param{'ssl'} ? %{$param{"ssl"};} : (), "PeerHost", $obj{'_host'}, "PeerPort", $obj{'_port'}) |
114
|
3 |
5 |
unless (eval {
do {
die $! unless $obj{'_socket'} = "IO::Socket::SSL"->new("SSL_hostname", $obj{'_host'}, $param{'tofu'} ? ("SSL_verifycn_scheme", "none") : (), "SSL_verify_callback", sub {
my($ok, $ctx_store, $certname, $error, $cert, $depth) = @_;
if ($depth != 0) {
return 1 if $param{'tofu'};
return $ok;
};
($param{'verify_ssl'} || \&Net::Gemini::_verify_ssl)->(@obj{"_host", "_port"}, &Net::SSLeay::X509_get_fingerprint($cert, "sha256"), &Net::SSLeay::P_ASN1_TIME_get_isotime(scalar &Net::SSLeay::X509_get_notBefore($cert)), &Net::SSLeay::P_ASN1_TIME_get_isotime(scalar &Net::SSLeay::X509_get_notAfter($cert)), $ok, $cert);
}
, exists $param{'ssl'} ? %{$param{"ssl"};} : (), "PeerHost", $obj{'_host'}, "PeerPort", $obj{'_port'});
1
}
}) |
122
|
0 |
5 |
unless (defined $n) |
131
|
0 |
5 |
if $param{'early_shutdown'} |
137
|
0 |
13 |
unless (defined $n) |
141
|
0 |
13 |
if ($n == 0) |
146
|
5 |
8 |
if length $obj{'_buf'} >= 3 |
148
|
3 |
2 |
if ($obj{'_buf'} =~ /^(([1-6])[0-9])[ ]/) { } |
163
|
1 |
2052 |
if ($obj{'_buf'} =~ /^(.{0,1024}?)\r\n/) { } |
166
|
0 |
1 |
if ($len == 0) { } |
173
|
0 |
1 |
unless (eval {
do {
$obj{'_meta'} = &Encode::decode("UTF-8", $obj{'_meta'}, 1);
1
}
}) |
182
|
2 |
2050 |
if ($len > 1024) |
188
|
0 |
2050 |
unless (defined $n) |
192
|
0 |
2050 |
if ($n == 0) |
201
|
4 |
13 |
if defined $obj{'_socket'} and $obj{'_code'} != 2 |
211
|
1 |
0 |
if ($len) |
212
|
0 |
1 |
unless &$callback($self->{'_buf'}, $len) |
219
|
0 |
1 |
if (not defined $len) { } |
|
1 |
0 |
elsif ($len == 0) { } |
224
|
0 |
0 |
unless &$callback($buf, $len) |