]> granicus.if.org Git - curl/commitdiff
fix the server for the slow response case
authorDaniel Stenberg <daniel@haxx.se>
Mon, 2 May 2005 10:03:12 +0000 (10:03 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 May 2005 10:03:12 +0000 (10:03 +0000)
tests/ftpserver.pl

index 3aed88b594efa02ac6b1dadfffbc8716a28ae844..dd8383fa6df56f0ada361a1b00f6ab4546f2d875 100644 (file)
@@ -585,17 +585,23 @@ sub PASV_command {
     eval {
         local $SIG{ALRM} = sub { die "alarm\n" };
 
-        alarm 5; # assume swift operations
+       # assume swift operations unless explicitly slow
+       alarm ($controldelay?20:5);
 
         # Wait for 'CNCT'
-        my $input = <DREAD>;
-
-        if($input !~ /^CNCT/) {
-            # we wait for a connected client
-            next;
-        }
-        logmsg "====> Client DATA connect\n";
-
+       my $input;
+       my $size;
+
+        while(sysread(DREAD, $input, $size)) {
+
+           if($input !~ /^CNCT/) {
+               # we wait for a connected client
+               logmsg "Odd, we got $input from client\n";
+               next;
+           }
+           logmsg "====> Client DATA connect\n";
+           last;
+       }
         alarm 0;
     };
     if ($@) {