| 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__ |