line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::QUIT; |
2
|
40
|
|
|
40
|
|
184
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
61
|
|
|
40
|
|
|
|
|
250
|
|
3
|
40
|
|
|
40
|
|
2379
|
use strictures; |
|
40
|
|
|
|
|
209
|
|
|
40
|
|
|
|
|
202
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
3334
|
$Net::Gnats::Command::QUIT::VERSION = '0.21'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
211
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
67
|
|
|
40
|
|
|
|
|
1642
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
211
|
use Net::Gnats::Constants qw(CODE_CLOSING); |
|
40
|
|
|
|
|
73
|
|
|
40
|
|
|
|
|
7844
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
QUIT |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Requests that the connection be closed. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
The QUIT command has the dubious distinction of being the only |
20
|
|
|
|
|
|
|
command that cannot fail. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 PROTOCOL |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
QUIT |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 RESPONSES |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Possible responses: |
29
|
|
|
|
|
|
|
201 (CODE_CLOSING) Normal exit. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $c = 'QUIT'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
5
|
|
|
5
|
1
|
14
|
my ( $class, %options ) = @_; |
37
|
5
|
|
|
|
|
20
|
my $self = bless {}, $class; |
38
|
5
|
|
|
|
|
28
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub as_string { |
42
|
10
|
|
|
10
|
1
|
17
|
my ($self) = @_; |
43
|
10
|
|
|
|
|
33
|
return $c; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_ok { |
47
|
4
|
|
|
4
|
0
|
6
|
my ($self) = @_; |
48
|
4
|
50
|
|
|
|
12
|
return 0 if not defined $self->response; |
49
|
4
|
50
|
|
|
|
14
|
return 0 if not defined $self->response->code; |
50
|
4
|
50
|
|
|
|
16
|
return 1 if $self->response->code == CODE_CLOSING; |
51
|
0
|
|
|
|
|
|
return 0; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |