line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::SMTP::Client::Response; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
22
|
use Mojo::Base -base; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
20
|
|
4
|
3
|
|
|
3
|
|
526
|
use overload '""' => \&to_string, fallback => 1; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
292
|
use constant CRLF => "\x0d\x0a"; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
1724
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'error'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
89
|
|
|
89
|
1
|
204
|
my $class = shift; |
12
|
89
|
|
|
|
|
150
|
my $resp = shift; |
13
|
|
|
|
|
|
|
|
14
|
89
|
|
|
|
|
473
|
my $self = $class->SUPER::new(@_); |
15
|
89
|
|
|
|
|
981
|
$self->{resp} = $resp; |
16
|
89
|
|
|
|
|
328
|
$self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub code { |
20
|
90
|
|
|
90
|
1
|
5680
|
my $self = shift; |
21
|
90
|
100
|
|
|
|
248
|
unless ($self->{code}) { |
22
|
82
|
|
|
|
|
271
|
$self->_parse_response(); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
90
|
|
|
|
|
490
|
$self->{code}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub message { |
29
|
11
|
|
|
11
|
1
|
1099
|
my $self = shift; |
30
|
11
|
100
|
|
|
|
318
|
unless ($self->{message}) { |
31
|
2
|
|
|
|
|
25
|
$self->_parse_response(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub to_string { |
36
|
23
|
|
|
23
|
1
|
21497
|
$_[0]->{resp}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _parse_response { |
40
|
84
|
|
|
84
|
|
148
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
84
|
100
|
|
|
|
484
|
my @lines = split CRLF, $self->{resp} or return; |
43
|
82
|
|
|
|
|
642
|
($self->{code}) = $lines[0] =~ /^(\d+)/; |
44
|
|
|
|
|
|
|
|
45
|
82
|
|
|
|
|
185
|
my @msg; |
46
|
|
|
|
|
|
|
|
47
|
82
|
|
|
|
|
230
|
for (@lines) { |
48
|
84
|
100
|
|
|
|
371
|
if (/^\d+[-\s](.+)/) { |
49
|
82
|
|
|
|
|
340
|
push @msg, $1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
82
|
|
|
|
|
472
|
$self->{message} = join CRLF, @msg; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |