Inspect/L5/NoData.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 36 CC 3 SCAR 16.7
CC
3
Cov
0%
guess_protocol
12.0
in
2.0
fatal
2.0
CRAP 5.3
1 ############################################################################
2 # Net::Inspect::L5::NoData
3 # handler for connections which don't transfer any bytes
4 ############################################################################
5 use warnings;
6 use strict;
7 package Net::Inspect::L5::NoData;
8 use base 'Net::Inspect::Connection';
9 use Net::Inspect::Debug;
10  
11 sub guess_protocol {
12 my ($self,$guess,$dir,$data,$eof,$meta) = @_;
13 if ($data ne '') {
14 # data transferred, not null
15 $guess->detach($self);
16 return;
17 } elsif ( $eof != 2 ) {
18 # not full eof
19 return;
20 } else {
21 debug("no bytes transfered before connection closed");
22 return ($self->new,0);
23 }
24 }
25  
26 sub in { die "never called" }
27 sub fatal { die "never called" }
28  
29  
30  
31 1;
32  
33 __END__