Branch Coverage

blib/lib/Net/Gnutella/Connection.pm
Criterion Covered Total %
branch 0 190 0.0


line true false branch
26 0 0 unless $attr =~ /[^A-Z]/
27 0 0 unless exists $$self{'_attr'}{lc $attr}
28 0 0 if @_
35 0 0 if $self->debug
37 0 0 if ($type)
60 0 0 unless ($packet and ref $packet)
67 0 0 if ($path) { }
68 0 0 if ($path ne $self)
69 0 0 if $self->debug >= 2
75 0 0 if $conn eq $self
76 0 0 unless $conn->connected
78 0 0 if $self->debug >= 2
122 0 0 if ($self->connected and $self->socket)
132 0 0 unless ($self->is_http)
172 0 0 unless ($self->is_http)
176 0 0 if (-f $file) { }
180 0 0 unless my $fh = 'IO::File'->new($file)
185 0 0 if ($offset and $offset > $size) { }
0 0 elsif ($offset) { }
188 0 0 unless $fh->seek($offset, 0)
191 0 0 $offset ? :
200 0 0 if $ce
201 0 0 $offset ? :
0 0 if $size
202 0 0 if $offset
203 0 0 if $mtime
218 0 0 unless ($self->is_established)
222 0 0 unless ($packet and ref $packet)
226 0 0 if $self->debug >= 2
230 0 0 unless (scalar @msgid)
247 0 0 unless ($self->is_http)
273 0 0 if $self->debug
275 0 0 unless ($packet and ref($packet) =~ /^Net::Gnutella::Packet::/)
279 0 0 if ($packet->hops > 7)
280 0 0 if $self->debug
284 0 0 if ($packet->ttl > 50)
285 0 0 if $self->debug
289 0 0 if ($packet->ttl > 7)
293 0 0 if ($packet->ttl <= 0) { }
294 0 0 if $self->debug
301 0 0 if ($type eq 'pong')
308 0 0 if ($type =~ /^(ping|query|push)$/) { }
0 0 elsif ($type =~ /^(pong|reply)$/) { }
309 0 0 if ($self->parent->_msgid_source($packet->msgid)) { }
315 0 0 unless ($self->parent->_msgid_source($packet->msgid))
316 0 0 if $self->debug
326 0 0 if ($type =~ /^(pong|reply)$/) { }
0 0 elsif ($type =~ /^(ping|push|query)$/) { }
341 0 0 if (scalar @$msgid) { }
349 0 0 wantarray ? :
358 0 0 if ($self->is_outgoing) { }
0 0 elsif ($self->is_incoming) { }
0 0 elsif ($self->is_established) { }
361 0 0 if ($ret == 0)
368 0 0 if ($buf eq "GNUTELLA OK\n\n")
382 0 0 if (length $buf >= 13)
390 0 0 if ($ret == 0)
397 0 0 if ($buf =~ m[^\w+[^\012]+HTTP/\d+\.\d+\015?\012]) { }
0 0 elsif ($buf =~ m[^GNUTELLA CONNECT/(\d+\.\d+)\015?\012\015?\012]) { }
0 0 elsif (length $buf > 1024) { }
398 0 0 if ($buf =~ /\015?\012\015?\012/) { }
0 0 elsif (length $buf > 1024) { }
399 0 0 unless ($self->allow & 2)
407 0 0 unless ($buf =~ s[^(\w+)[ \t]+(.+)[ \t]+(HTTP/\d+\.\d+)[^\012]*\012][])
422 0 0 if (/^([\w\-]+)\s*:\s*(.*)/) { }
0 0 elsif (/^\s+(.*)/) { }
423 0 0 if $key
432 0 0 if $key
449 0 0 if ($1 le '0.4') { }
450 0 0 unless ($self->allow & 1)
480 0 0 if ($ret == 0)
487 0 0 if $self->debug
490 0 0 if (length $buf < 23)
500 0 0 if (length $buf < 23 + $len)
507 0 0 if $self->debug
511 0 0 if ($func == 0) { }
0 0 elsif ($func == 1) { }
0 0 elsif ($func == 64) { }
0 0 elsif ($func == 128) { }
0 0 elsif ($func == 129) { }
512 0 0 if $len != 0
515 0 0 if $len != 14
518 0 0 if $len != 26
521 0 0 if $len >= 257
524 0 0 if $len >= 67075
549 0 0 if $self->debug
555 0 0 if ($self->is_upload) { }
571 0 0 if $self->debug
573 0 0 if (length $buf == 0)
579 0 0 if ($len == 0)
586 0 0 if $self->debug
588 0 0 if ($self->is_upload and defined $fh)
596 0 0 if (length $buf)
602 0 0 if ($self->is_upload and $fh and ref $fh eq 'IO::File') { }
0 0 elsif ($self->is_http) { }