Branch Coverage

blib/lib/Net/QMTP.pm
Criterion Covered Total %
branch 34 202 16.8


line true false branch
35 0 1 unless my $proto = shift()
37 0 1 unless my $server = shift()
40 1 0 if @_
55 0 1 if ($args{'Debug'})
60 0 1 unless $$self{'SERVER'} = $server
61 0 1 if $$self{'DEBUG'}
63 0 1 unless ($self->encoding('__GUESS__'))
67 0 1 if ($args{'ConnectTimeout'})
69 0 0 if $$self{'DEBUG'}
71 0 1 if ($args{'Port'})
73 0 0 if $$self{'DEBUG'}
75 0 1 unless ($args{'DeferConnect'})
76 0 0 if $$self{'DEBUG'}
77 0 0 unless $self->reconnect
79 0 1 if $$self{'DEBUG'}
85 0 0 unless ref $self
90 0 0 if (defined $sock)
93 0 0 unless $self->disconnect
97 0 0 if $$self{'DEBUG'}
98 0 0 if ($$self{'TIMEOUT'}) { }
99 0 0 if $$self{'DEBUG'}
100 0 0 unless $sock = 'IO::Socket::INET'->new('PeerAddr', $$self{'SERVER'}, 'PeerPort', $$self{'PORT'}, 'Timeout', $$self{'TIMEOUT'}, 'Proto', 'tcp')
106 0 0 if $$self{'DEBUG'}
107 0 0 unless $sock = 'IO::Socket::INET'->new('PeerAddr', $$self{'SERVER'}, 'PeerPort', $$self{'PORT'}, 'Proto', 'tcp')
116 0 0 if $$self{'DEBUG'}
118 0 0 if $$self{'DEBUG'}
124 0 1 unless ref $self
129 1 0 unless (defined $sock)
144 0 0 if $$self{'DEBUG'}
145 0 0 unless (close $sock)
150 0 0 if $$self{'DEBUG'}
157 0 1 unless ref $self
158 0 1 unless my $e = shift()
161 1 0 if ($e eq '__GUESS__') { }
0 0 elsif ($e eq 'dos') { }
0 0 elsif ($e eq 'unix') { }
162 0 1 if $$self{'DEBUG'}
163 0 1 if ($/ eq "\r\n") { }
165 0 0 if $$self{'DEBUG'}
168 0 1 if $$self{'DEBUG'}
174 0 0 if $$self{'DEBUG'}
177 0 0 if $$self{'DEBUG'}
188 0 1 unless ref $self
189 0 1 if @_
190 0 1 if $$self{'DEBUG'}
196 0 3 unless ref $self
197 1 2 if @_
198 0 3 if $$self{'DEBUG'}
204 0 4 unless ref $self
205 2 2 if @_
206 0 4 if $$self{'DEBUG'}
213 0 0 unless ref $self
214 0 0 if $$self{'DEBUG'}
215 0 0 if ($$self{'MSGFILE'})
219 0 0 if @_
220 0 0 if $$self{'DEBUG'}
227 0 0 unless ref $self
228 0 0 if $$self{'DEBUG'}
229 0 0 if (defined $$self{'MESSAGE'})
233 0 0 unless my $f = shift()
239 0 0 if $$self{'DEBUG'}
246 0 0 unless ref $self
250 0 0 if $$self{'DEBUG'}
256 0 1 unless ref $self
260 0 1 if $$self{'DEBUG'}
266 0 0 unless ref $self
270 0 0 if $$self{'DEBUG'}
271 0 0 unless (open FILE, $f)
278 0 0 if ($size < 0)
284 0 0 unless print $sock $size + 1 . ':' . $$self{'ENCODING'}
285 0 0 unless print $sock $_
287 0 0 if ($size != $len)
291 0 0 unless print $sock ','
292 0 0 unless (close FILE)
296 0 0 if $$self{'DEBUG'}
302 0 0 unless ref $self
304 0 0 if $$self{'DEBUG'}
305 0 0 unless $self->_ready_to_send
309 0 0 if ($$self{'MSGFILE'}) { }
310 0 0 if $$self{'DEBUG'}
312 0 0 unless $self->_send_file
314 0 0 if $$self{'DEBUG'}
315 0 0 unless print $sock netstring_encode($$self{'ENCODING'} . $$self{'MESSAGE'})
322 0 0 if $$self{'DEBUG'}
323 0 0 unless print $sock $s
326 0 0 if $$self{'DEBUG'}
327 0 0 unless print $sock $s
331 0 0 if $$self{'DEBUG'}
333 0 0 if $$self{'DEBUG'}
334 0 0 if $s =~ s/^K/success: /
336 0 0 if $s =~ s/^Z/deferral: /
337 0 0 if $s =~ s/^D/failure: /
343 0 0 if $$self{'DEBUG'}
349 0 0 unless ref $self
351 0 0 if $$self{'DEBUG'}
361 0 0 unless ref $self
363 0 0 if (time - $$self{'CONNECTTIME'} > $$self{'SESSIONLIMIT'})
373 0 0 unless ref $self
378 0 0 if (defined $s and netstring_verify($s))
394 0 1 unless ref $self
395 0 1 if $$self{'SOCKET'}