Branch Coverage

blib/lib/MongoDB/_Link.pm
Criterion Covered Total %
branch 14 110 12.7


line true false branch
270 0 106 unless @_ == 1
273 0 106 if ($self->with_ssl)
287 106 0 lc $host eq 'localhost' ? :
106 0 $self->connect_timeout >= 0 ? :
106 0 unless my $fh = $SOCKET_CLASS->new('PeerHost', $ENV{'TEST_MONGO_SOCKET_HOST'} || $host, 'PeerPort', $port, lc $host eq 'localhost' ? ('Family', 2) : (), 'Proto', 'tcp', 'Type', 1, 'Timeout', $self->connect_timeout >= 0 ? $self->connect_timeout : undef)
297 0 0 unless (binmode $fh)
302 0 0 unless (defined $fh->setsockopt(6, 1, 1))
307 0 0 unless (defined $fh->setsockopt(1, 9, 1))
316 0 0 unless (defined $fd and $fd >= 0)
323 0 0 if $self->with_ssl
348 0 1 if ($self->accepts_wire_version(2))
351 0 1 if ($self->accepts_wire_version(3))
355 0 1 if ($self->accepts_wire_version(4))
363 0 1 if ($self->accepts_wire_version(5))
368 0 1 if ($self->accepts_wire_version(6))
372 0 0 defined $server->logical_session_timeout_minutes && $server->type ne 'Standalone' ? :
381 0 1 if ($self->accepts_wire_version(7))
384 0 1 if ($self->accepts_wire_version(8))
411 0 0 unless (ref $self->fh eq 'IO::Socket::SSL')
420 0 0 unless $self->fh and $self->fh->isa('IO::Socket::SSL')
422 0 0 unless my $client_cert = $self->fh->sock_certificate
425 0 0 unless my $subject_raw = Net::SSLeay::X509_get_subject_name($client_cert)
436 0 0 unless $self->_close
445 0 0 if ($self->fh)
461 0 1 if (not $write_opt->{'disable_compression'} and $self->server and $self->server->compressor)
476 1 0 if $len > $self->max_message_size_bytes
485 0 0 if (-1 == ($nfound = select(undef, $self->fdset, undef, $pending)))
486 0 0 unless ($! == 4)
498 0 0 unless ($nfound)
505 0 0 if (defined($r = syswrite($self->fh, $buf, $len, $off))) { }
0 0 elsif ($! == 32) { }
0 0 elsif ($! != 4) { }
507 0 0 unless $len > 0
514 0 0 if ($self->fh->can('errstr')) { }
544 0 0 if ($self->with_ssl)
545 0 0 if $self->fh->pending
549 0 0 if (-1 == ($nfound = select($self->fdset, undef, undef, $pending)))
550 0 0 unless ($! == 4)
562 0 0 unless ($nfound)
569 0 0 if (defined($r = sysread($self->fh, $msg, $self->rcvbuf, length $msg))) { }
0 0 elsif ($! != 4) { }
572 0 0 unless ($r)
578 0 0 if ($self->fh->can('errstr')) { }
589 0 0 unless (defined $len)
590 0 0 if length $msg < 4
594 0 0 if $len > $self->max_message_size_bytes
596 0 0 unless length $msg < $len
607 0 0 unless eval { do { require IO::Socket::SSL; 'IO::Socket::SSL'->VERSION(1.42) } }
610 0 0 unless eval { do { require Net::SSLeay; 'Net::SSLeay'->VERSION(1.49) } }
619 0 0 if $self->SSL_options->{'SSL_ca_file'} and -e $self->SSL_options->{'SSL_ca_file'}
622 0 0 if eval { do { require Mozilla::CA } }
635 0 0 if -e $ca_bundle
650 0 0 if (Net::SSLeay::OPENSSL_VERSION_NUMBER() >= 268435456)
654 0 0 if (Net::SSLeay::OPENSSL_VERSION_NUMBER() >= 269484032)
665 0 0 if $k =~ /^SSL_/