line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::SMTP::Client::Response; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
17
|
use Mojo::Base -base; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
15
|
|
4
|
3
|
|
|
3
|
|
378
|
use overload '""' => \&to_string, fallback => 1; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
17
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
196
|
use constant CRLF => "\x0d\x0a"; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1149
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'error'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
89
|
|
|
89
|
1
|
174
|
my $class = shift; |
12
|
89
|
|
|
|
|
164
|
my $resp = shift; |
13
|
|
|
|
|
|
|
|
14
|
89
|
|
|
|
|
333
|
my $self = $class->SUPER::new(@_); |
15
|
89
|
|
|
|
|
829
|
$self->{resp} = $resp; |
16
|
89
|
|
|
|
|
299
|
$self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub code { |
20
|
90
|
|
|
90
|
1
|
3949
|
my $self = shift; |
21
|
90
|
100
|
|
|
|
199
|
unless ($self->{code}) { |
22
|
82
|
|
|
|
|
297
|
$self->_parse_response(); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
90
|
|
|
|
|
405
|
$self->{code}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub message { |
29
|
11
|
|
|
11
|
1
|
1063
|
my $self = shift; |
30
|
11
|
100
|
|
|
|
237
|
unless ($self->{message}) { |
31
|
2
|
|
|
|
|
12
|
$self->_parse_response(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub to_string { |
36
|
23
|
|
|
23
|
1
|
16383
|
$_[0]->{resp}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _parse_response { |
40
|
84
|
|
|
84
|
|
178
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
84
|
100
|
|
|
|
430
|
my @lines = split CRLF, $self->{resp} or return; |
43
|
82
|
|
|
|
|
592
|
($self->{code}) = $lines[0] =~ /^(\d+)/; |
44
|
|
|
|
|
|
|
|
45
|
82
|
|
|
|
|
206
|
my @msg; |
46
|
|
|
|
|
|
|
|
47
|
82
|
|
|
|
|
167
|
for (@lines) { |
48
|
84
|
100
|
|
|
|
367
|
if (/^\d+[-\s](.+)/) { |
49
|
82
|
|
|
|
|
348
|
push @msg, $1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
82
|
|
|
|
|
421
|
$self->{message} = join CRLF, @msg; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |