| 1 | package AnyEvent::PacketReader; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 1 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 1 | require Exporter; | |||||||||||||||||||||||||||||||
| 10 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||
| 11 | 1 | our @EXPORT = qw(packet_reader); | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use AnyEvent; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use Errno qw(EPIPE EBADMSG EMSGSIZE EINTR EAGAIN EWOULDBLOCK); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 1 | our $MAX_TOTAL_LENGTH = 1e6; | |||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | 1 | our $debug; | |||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||
| 21 | 1 | my %header_length = ( n => 2, | |||||||||||||||||||||||||||||||
| 22 | v => 2, | ||||||||||||||||||||||||||||||||
| 23 | N => 4, | ||||||||||||||||||||||||||||||||
| 24 | V => 4, | ||||||||||||||||||||||||||||||||
| 25 | W => 1, | ||||||||||||||||||||||||||||||||
| 26 | S => 2, | ||||||||||||||||||||||||||||||||
| 27 | L => 4, | ||||||||||||||||||||||||||||||||
| 28 | Q => 8 ); | ||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | 1 | for my $dir (qw(> <)) { | |||||||||||||||||||||||||||||||
| 31 | 2 | for my $t (qw(S L Q)) { | |||||||||||||||||||||||||||||||
| 32 | 6 | $header_length{"$t$dir"} = $header_length{$t}; | |||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 1 | my %short_templ = map { $_ => $_ } keys %header_length; | |||||||||||||||||||||||||||||||
| 37 | 1 | my %load_offset = %header_length; | |||||||||||||||||||||||||||||||
| 38 | 1 | my $good_packers = join '', keys %header_length; | |||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||
| 40 | 1 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | $SIG{INT} = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 42 | 0 | print Data::Dumper->Dump([\%short_templ, \%header_length, \%load_offset], [qw(%short_templ %header_length %load_offset)]); | |||||||||||||||||||||||||||||||
| 43 | 0 | exit 1; | |||||||||||||||||||||||||||||||
| 44 | 1 | }; | |||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | sub packet_reader { | ||||||||||||||||||||||||||||||
|
Subroutine
packet_reader: not called CC=20 SCAR=60.4
Pod
documented
| |||||||||||||||||||||||||||||||||
| 47 | 0 | my $cb = pop; | |||||||||||||||||||||||||||||||
| 48 | 0 | my ($fh, $templ, $max_total_length) = @_; | |||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | croak 'Usage: packet_reader($fh, [$templ, [$max_total_length,]] $callback)' | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $fh and defined $cb
MC/DC0%0/2
defined $fh and defined $cb
defined $fh
defined $cb
Truth table0%0/3
A and B
A= defined $fhB= defined $cb
| |||||||||||||||||||||||||||||||||
| 50 | unless defined $fh and defined $cb; | ||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | $max_total_length ||= $MAX_TOTAL_LENGTH; | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$max_total_length ||= $AnyEvent::PacketReader::MAX_TOTAL_LENGTH
MC/DC0%0/2
$max_total_length ||= $AnyEvent::PacketReader::MAX_TOTAL_LENGTH
$max_total_length
$AnyEvent::PacketReader::MAX_TOTAL_LENGTH
Truth table0%0/3
A ||= B
A= $max_total_lengthB= $AnyEvent::PacketReader::MAX_TOTAL_LENGTH
| |||||||||||||||||||||||||||||||||
| 53 | 0 | my ($header_length, $load_offset, $short_templ); | |||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | if (defined $templ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | unless (defined($short_templ = $short_templ{$templ})) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | $debug and warn "PR: examining template '$templ'\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 58 | 0 | my $load_offset; | |||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | if ($templ =~ /^(x+)(\d*)/g) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | $header_length = length($1) + (length $2 ? $2 - 1 : 0); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||
| 62 | elsif ($templ =~ /^\@!(\d*)/g) { | ||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | $header_length = (length $1 ? $1 : 1); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||
| 65 | else { | ||||||||||||||||||||||||||||||||
| 66 | 0 | $header_length = 0; | |||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | $templ =~ /\G([$good_packers][<>]?)/go | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 70 | or croak "bad header template '$templ'"; | ||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | $header_length += ($header_length{$1} // die "Internal error: \$header_length{$1} is not defined"); | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$header_length{$1} // die("Internal error: \$header_length{$1} is not defined")
MC/DC0%0/1
$header_length{$1} // die("Internal error: \$header_length{$1} is not defined")
$header_length{$1}
Truth table0%0/2
A
A= $header_length{$1}
| |||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||
| 74 | 0 | $short_templ = substr $templ, 0, pos($templ); | |||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | if ($templ =~ /\G\@!(\d*)/g) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | $load_offset = (length $1 ? $1 : 1); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||
| 80 | else { | ||||||||||||||||||||||||||||||||
| 81 | 0 | $load_offset = $header_length; | |||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | if ($templ =~ /\G(x+)(\d*)/g) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | $load_offset += length $1 + (length $2 ? $2 - 1 : 0); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | $templ =~ /\G$/g or croak "bad header template '$templ'"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||
| 89 | 0 | $short_templ{$templ} = $short_templ; | |||||||||||||||||||||||||||||||
| 90 | 0 | $header_length{$templ} = $header_length; | |||||||||||||||||||||||||||||||
| 91 | 0 | $load_offset{$templ} = $load_offset; | |||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | $debug and warn "PR: template '$templ' examined, header_length: $header_length, load_offset: $load_offset\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||
| 95 | 0 | $header_length = $header_length{$templ}; | |||||||||||||||||||||||||||||||
| 96 | 0 | $load_offset = $load_offset{$templ}; | |||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||
| 99 | else { | ||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | $debug and warn "PR: defaulting to template 'N'\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 101 | 0 | $templ = 'N'; | |||||||||||||||||||||||||||||||
| 102 | 0 | $header_length = 4; | |||||||||||||||||||||||||||||||
| 103 | 0 | $load_offset = 4; | |||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||
| 106 | # data is: 0:buffer, 1:fh, 2:watcher, 3:header_length, 4:total_length, 5:short_templ, 6:max_total_length, 7:cb, 8:load_offset | ||||||||||||||||||||||||||||||||
| 107 | 0 | my $data = ['' , $fh , undef , $header_length , undef , $short_templ , $max_total_length , $cb , $load_offset ]; | |||||||||||||||||||||||||||||||
| 108 | 0 | my $obj = \$data; | |||||||||||||||||||||||||||||||
| 109 | 0 | bless $obj; | |||||||||||||||||||||||||||||||
| 110 | 0 | $obj->resume; | |||||||||||||||||||||||||||||||
| 111 | 0 | $obj; | |||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | sub pause { | ||||||||||||||||||||||||||||||
|
Subroutine
pause: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 115 | 0 | my $data = ${shift()}; | |||||||||||||||||||||||||||||||
| 116 | 0 | $data->[2] = undef; | |||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | sub resume { | ||||||||||||||||||||||||||||||
|
Subroutine
resume: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 120 | 0 | my $data = ${shift()}; | |||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | if (defined(my $fh = $data->[1])) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | $data->[2] = AE::io $fh, 0, sub { _read($data) }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||
| 127 | 0 | my $obj = shift; | |||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | $debug and warn "PR: watcher is gone, aborting read\n" if ${$obj}->[3]; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
${$obj;}->[3] && ($AnyEvent::PacketReader::debug && warn("PR: watcher is gone, aborting read\n"))
$AnyEvent::PacketReader::debug and warn "PR: watcher is gone, aborting read\n"
MC/DC0%0/2
${$obj;}->[3] && ($AnyEvent::PacketReader::debug && warn("PR: watcher is gone, aborting read\n"))
${$obj;}->[3]
$AnyEvent::PacketReader::debug
Truth table0%0/3
A && B
A= ${$obj;}->[3]B= $AnyEvent::PacketReader::debug
| |||||||||||||||||||||||||||||||||
| 129 | 0 | @{$$obj} = (); | |||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | sub _hexdump { | ||||||||||||||||||||||||||||||
|
Subroutine
_hexdump: not called CC=3 SCAR=20.8
| |||||||||||||||||||||||||||||||||
| 133 | 0 | local ($!, $@); | |||||||||||||||||||||||||||||||
| 134 | 1 | ▶ | no warnings qw(uninitialized); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | while ($_[0] =~ /(.{1,32})/smg) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 136 | 0 | my $line = $1; | |||||||||||||||||||||||||||||||
| 137 | 0 | my @c= (( map { sprintf "%02x",$_ } unpack('C*', $line)), | |||||||||||||||||||||||||||||||
| 138 | ((" ") x 32))[0..31]; | ||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | $line=~s/(.)/ my $c=$1; unpack("c",$c)>=32 ? $c : '.' /egms; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 140 | 0 | print STDERR "$_[1] ", join(" ", @c, '|', $line), "\n"; | |||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||
| 142 | 0 | print STDERR "\n"; | |||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||
| 146 | 0 | ▶ | sub _read { | ||||||||||||||||||||||||||||||
|
Subroutine
_read: not called CC=21 SCAR=61.4
| |||||||||||||||||||||||||||||||||
| 147 | 0 | my $data = shift; | |||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | my $length = $data->[4] || $data->[3]; | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$data->[4] || $data->[3]
MC/DC0%0/2
$data->[4] || $data->[3]
$data->[4]
$data->[3]
Truth table0%0/3
A || B
A= $data->[4]B= $data->[3]
| |||||||||||||||||||||||||||||||||
| 149 | 0 | my $offset = length $data->[0]; | |||||||||||||||||||||||||||||||
| 150 | 0 | my $remaining = $length - $offset; | |||||||||||||||||||||||||||||||
| 151 | 0 | my $bytes = sysread($data->[1], $data->[0], $remaining, $offset); | |||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | if ($bytes) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | $debug and warn "PR: $bytes bytes read\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | if (length $data->[0] == $length) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | unless (defined $data->[4]) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 156 | 0 | my $load_length = unpack $data->[5], $data->[0]; | |||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | unless (defined $load_length) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | $debug and warn "PR: unable to extract size field from header\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 159 | 0 | return _fatal($data, EBADMSG); | |||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||
| 161 | 0 | my $total_length = $data->[8] + $load_length; | |||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | $debug and warn "PR: reading full packet ". | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 163 | "(load length: $load_length, total: $total_length, current: $length)\n"; | ||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | if ($total_length > $data->[6]) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | $debug and warn "PR: received packet is too long\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 167 | 0 | return _fatal($data, EMSGSIZE) | |||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if ($length < $total_length) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 170 | 0 | $data->[4] = $total_length; | |||||||||||||||||||||||||||||||
| 171 | 0 | return; | |||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||
| 173 | # else, the packet is done | ||||||||||||||||||||||||||||||||
| 174 | 0 | ▶ | if ($length > $total_length) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | $debug and warn "PR: header length ($length) > total length ($total_length)\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 176 | 0 | return _fatal($data, EBADMSG); | |||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | $debug and warn "PR: packet read, invoking callback\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 181 | 0 | $data->[7]->($data->[0]); | |||||||||||||||||||||||||||||||
| 182 | # somebody may have taken a reference to the buffer so we start clean: | ||||||||||||||||||||||||||||||||
| 183 | 0 | @$data = ('', @$data[1..3], undef, @$data[5..$#$data]); | |||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | $debug and warn "PR: waiting for a new packet\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||
| 187 | elsif (defined $bytes) { | ||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | $debug and warn "PR: EOF!\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 189 | 0 | return _fatal($data, EPIPE); | |||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||
| 191 | else { | ||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | $debug and warn "PR: sysread failed: $!\n"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | $! == $_ and return for (EINTR, EAGAIN, EWOULDBLOCK); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 194 | 0 | return _fatal($data); | |||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | sub _fatal { | ||||||||||||||||||||||||||||||
|
Subroutine
_fatal: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||
| 199 | 0 | my $data = shift; | |||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | local $! = shift if @_; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | if ($debug) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 202 | 0 | warn "PR: fatal error: $!\n"; | |||||||||||||||||||||||||||||||
| 203 | 0 | _hexdump($data->[0], 'pkt:'); | |||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||
| 205 | 0 | $data->[7]->(); | |||||||||||||||||||||||||||||||
| 206 | 0 | @$data = (); # release watcher; | |||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||
| 209 | 1 | 1; | |||||||||||||||||||||||||||||||
| 210 | __END__ | ||||||||||||||||||||||||||||||||