line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::QUIT; |
2
|
40
|
|
|
40
|
|
208
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
70
|
|
|
40
|
|
|
|
|
226
|
|
3
|
40
|
|
|
40
|
|
2158
|
use strictures; |
|
40
|
|
|
|
|
78
|
|
|
40
|
|
|
|
|
222
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
9465
|
$Net::Gnats::Command::QUIT::VERSION = '0.22'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
207
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
77
|
|
|
40
|
|
|
|
|
1639
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
232
|
use Net::Gnats::Constants qw(CODE_CLOSING); |
|
40
|
|
|
|
|
87
|
|
|
40
|
|
|
|
|
8619
|
|
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
|
16
|
my ( $class, %options ) = @_; |
37
|
5
|
|
|
|
|
11
|
my $self = bless {}, $class; |
38
|
5
|
|
|
|
|
28
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub as_string { |
42
|
10
|
|
|
10
|
1
|
17
|
my ($self) = @_; |
43
|
10
|
|
|
|
|
38
|
return $c; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_ok { |
47
|
4
|
|
|
4
|
0
|
9
|
my ($self) = @_; |
48
|
4
|
50
|
|
|
|
14
|
return 0 if not defined $self->response; |
49
|
4
|
50
|
|
|
|
15
|
return 0 if not defined $self->response->code; |
50
|
4
|
50
|
|
|
|
17
|
return 1 if $self->response->code == CODE_CLOSING; |
51
|
0
|
|
|
|
|
|
return 0; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |