aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-10-08 08:43:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-10-08 08:43:32 +0000
commitef66497a0d6ec2b7136e16f22a61a91e660ce9f9 (patch)
tree3879292db368f86be460d4d6ecc42065acc3a26e
parent1128029599b1c7e65bf304a3d8bcf2e6aadce72a (diff)
Fix a "sockfilt" leak. When a new 'data' connection sockfilt server is started,
make sure that a previously used one is killed first (since they re-use the same .pid file etc)
-rw-r--r--tests/ftpserver.pl10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 5abda5e3c..0882dac37 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -521,10 +521,17 @@ sub STOR_command {
sub PASV_command {
my ($arg, $cmd)=@_;
my $pasvport;
+ my $pidf=".sockdata$ftpdnum$ext.pid";
+
+ my $prev = checkserver($pidf);
+ if($prev > 0) {
+ print "kill existing server: $prev\n" if($verbose);
+ kill(9, $prev);
+ }
# We fire up a new sockfilt to do the data tranfer for us.
$slavepid = open2(\*DREAD, \*DWRITE,
- "./server/sockfilt --port 0 --logfile log/sockdata$ftpdnum$ext.log --pidfile .sockdata$ftpdnum$ext.pid $ipv6");
+ "./server/sockfilt --port 0 --logfile log/sockdata$ftpdnum$ext.log --pidfile $pidf $ipv6");
print DWRITE "PING\n";
my $pong;
@@ -662,6 +669,7 @@ sub PORT_command {
logmsg "Failed sockfilt for data connection\n";
kill(9, $slavepid);
}
+
logmsg "====> Client DATA connect to port $port\n";
return;