| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights 2009-2011 by Mark Overmeer. |
|
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
|
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
|
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.00. |
|
5
|
1
|
|
|
1
|
|
225995
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
39
|
|
|
6
|
1
|
|
|
1
|
|
7
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
48
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Net::FTPSSL::Robust; |
|
9
|
1
|
|
|
1
|
|
17
|
use vars '$VERSION'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
52
|
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.05'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
6
|
use base 'Net::FTP::Robust', 'Exporter'; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
154
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @EXPORT = |
|
15
|
|
|
|
|
|
|
qw/SECURITY_TLS |
|
16
|
|
|
|
|
|
|
SECURITY_SSL/; |
|
17
|
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
6
|
use Log::Report 'net-ftpssl-robust', syntax => 'SHORT'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
12
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
1920
|
use Net::FTPSSL; |
|
|
1
|
|
|
|
|
108959
|
|
|
|
1
|
|
|
|
|
191
|
|
|
21
|
|
|
|
|
|
|
# Gladly, ::FTPSSL has some level of interface compatibility with Net::FTP |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use constant |
|
24
|
1
|
|
|
|
|
349
|
{ SECURITY_TLS => 'TLS' |
|
25
|
|
|
|
|
|
|
, SECURITY_SSL => 'SSL' |
|
26
|
1
|
|
|
1
|
|
14
|
}; |
|
|
1
|
|
|
|
|
2
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub init($) |
|
30
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
|
31
|
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
if(my $sec = delete $args->{Security}) |
|
33
|
0
|
0
|
|
|
|
|
{ $args->{useSSL} = |
|
|
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$sec eq SECURITY_TLS ? 0 |
|
35
|
|
|
|
|
|
|
: $sec eq SECURITY_SSL ? 1 |
|
36
|
|
|
|
|
|
|
: error "unknown security protocol {proto}", proto => $sec; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
$self->SUPER::init($args); |
|
40
|
0
|
|
|
|
|
|
$self; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _connect($) |
|
45
|
0
|
|
|
0
|
|
|
{ my ($self, $opts) = @_; |
|
46
|
0
|
0
|
|
|
|
|
my $host = $opts->{Host} |
|
47
|
|
|
|
|
|
|
or error "no host provided to connect to"; |
|
48
|
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my $ftp = Net::FTPSSL->new($host, %$opts); |
|
50
|
0
|
0
|
|
|
|
|
my $err = defined $ftp ? undef : $Net::FTPSSL::ERRSTR; |
|
51
|
0
|
|
|
|
|
|
($ftp, $err); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _modif_time($$) |
|
55
|
0
|
|
|
0
|
|
|
{ my ($self, $ftp, $fn) = @_; |
|
56
|
0
|
|
|
|
|
|
$ftp->_mdtm($fn); |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
0
|
|
|
0
|
|
|
sub _ls($) { $_[1]->nlst } |
|
60
|
|
|
|
|
|
|
|
|
61
|
0
|
|
|
0
|
|
|
sub _can_restart($$$) { 1 } |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |