line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::SMTP::Client::Response; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
20
|
use Mojo::Base -base; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
17
|
|
4
|
3
|
|
|
3
|
|
479
|
use overload '""' => \&to_string, fallback => 1; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
279
|
use constant CRLF => "\x0d\x0a"; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
1529
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'error'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
89
|
|
|
89
|
1
|
200
|
my $class = shift; |
12
|
89
|
|
|
|
|
154
|
my $resp = shift; |
13
|
|
|
|
|
|
|
|
14
|
89
|
|
|
|
|
369
|
my $self = $class->SUPER::new(@_); |
15
|
89
|
|
|
|
|
798
|
$self->{resp} = $resp; |
16
|
89
|
|
|
|
|
288
|
$self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub code { |
20
|
90
|
|
|
90
|
1
|
4521
|
my $self = shift; |
21
|
90
|
100
|
|
|
|
225
|
unless ($self->{code}) { |
22
|
82
|
|
|
|
|
263
|
$self->_parse_response(); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
90
|
|
|
|
|
432
|
$self->{code}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub message { |
29
|
11
|
|
|
11
|
1
|
864
|
my $self = shift; |
30
|
11
|
100
|
|
|
|
309
|
unless ($self->{message}) { |
31
|
2
|
|
|
|
|
11
|
$self->_parse_response(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub to_string { |
36
|
23
|
|
|
23
|
1
|
17711
|
$_[0]->{resp}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _parse_response { |
40
|
84
|
|
|
84
|
|
129
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
84
|
100
|
|
|
|
396
|
my @lines = split CRLF, $self->{resp} or return; |
43
|
82
|
|
|
|
|
619
|
($self->{code}) = $lines[0] =~ /^(\d+)/; |
44
|
|
|
|
|
|
|
|
45
|
82
|
|
|
|
|
154
|
my @msg; |
46
|
|
|
|
|
|
|
|
47
|
82
|
|
|
|
|
177
|
for (@lines) { |
48
|
84
|
100
|
|
|
|
315
|
if (/^\d+[-\s](.+)/) { |
49
|
82
|
|
|
|
|
322
|
push @msg, $1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
82
|
|
|
|
|
453
|
$self->{message} = join CRLF, @msg; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |