]> sjero.net Git - wget/blobdiff - tests/FTPServer.pm
Add new test.
[wget] / tests / FTPServer.pm
index dd06538749fd83b6045af2c531380972455bf5d1..87e7983977f897ae78fb3148d3f164c0cdccaa8b 100644 (file)
@@ -457,7 +457,7 @@ sub __open_data_connection
         $_attr_data{$attr};
     }
 
-    sub _standard_keys 
+    sub _standard_keys
     {
         keys %_attr_data;
     }
@@ -489,6 +489,12 @@ sub new {
                                              Proto => 'tcp',
                                              Type => SOCK_STREAM)
                                         or die "bind: $!";
+
+    foreach my $file (keys %{$self->{_input}}) {
+        my $ref = \$self->{_input}{$file}{content};
+        $$ref =~ s/{{port}}/$self->sockport/eg;
+    }
+
     return $self;
 }
 
@@ -562,10 +568,10 @@ sub run
 
             print STDERR "in child\n" if $log;
 
-            my $conn = { 
+            my $conn = {
                 'paths'           => FTPPaths->new($self->{'_input'},
                                         $self->{'_server_behavior'}),
-                'socket'          => $socket, 
+                'socket'          => $socket,
                 'state'           => $_connection_states{NEWCONN},
                 'dir'             => '/',
                 'restart'         => 0,
@@ -778,7 +784,7 @@ sub get_list {
     my $info = $self->get_info($path);
     return undef unless defined $info;
     my $list = [];
-    
+
     if ($info->{'_type'} eq 'd') {
         for my $item (keys %$info) {
             next if $item =~ /^_/;