- #
- # accepted default key => value pairs to Net::FTP
- #
- my $args = {
- Host => undef,
- Firewall => undef, # not used
- FirewallType => undef, # not used
- BlockSize => 10240,
- Port => 21,
- Timeout => 120,
- Debug => 0, # do not touch
- Passive => 1, # do not touch
- Hash => undef, # do not touch
- LocalAddr => "localhost", # do not touch
- };
-
- #
- # This is mostly to fool makeDist
- #
- exists( $conf->{ClientNameAlias} ) && exists( $conf->{FtpBlockSize} ) &&
- exists( $conf->{FtpPort} ) && exists( $conf->{FtpTimeout} )
- or die "Configuration variables for FTP not present in config.pl";
-
- #
- # map of options from %Conf in the config.pl scripts to options
- # the Net::FTP::AutoReconnect object.
- #
- my $argMap = {
- "Host" => "ClientNameAlias",
- "BlockSize" => "FtpBlockSize",
- "Port" => "FtpPort",
- "Timeout" => "FtpTimeout",
- };
-
- foreach my $key ( keys(%$args) ) {
- $args->{$key} = $conf->{ $argMap->{$key} } || $args->{$key};
- }
-
- #
- # Fix for $args->{Host} since it can be in more than one location.
- # Note the precedence here, this may need to be fixed. Order of
- # precedence:
- # $conf->{ClientNameAlias}
- # $t->{hostIP}
- # $t->{host}
- #
- $args->{Host} ||= $t->{hostIP};
- $args->{Host} ||= $t->{host};
-
- #
- # return the reference to the hash of items
- #
- return $args;
+ return {
+ Host => $conf->{ClientNameAlias}
+ || $t->{hostIP}
+ || $t->{host},
+ Firewall => undef, # not used
+ FirewallType => undef, # not used
+ BlockSize => $conf->{FtpBlockSize} || 10240,
+ Port => $conf->{FtpPort} || 21,
+ Timeout => $conf->{FtpTimeout} || 120,
+ Debug => 0, # do not touch
+ Passive => 1, # do not touch
+ Hash => undef, # do not touch
+ LocalAddr => "localhost", # do not touch
+ };