FTP sessions disconnect after about a minute of user idle even if user max idle
time is set to infinite
-------------------------------------------------------------------------------------------------------
Key: FTPSERVER-78
URL: https://issues.apache.org/jira/browse/FTPSERVER-78
Project: FtpServer
Issue Type: Bug
Components: Core
Affects Versions: 1.0-M1, 1.0-M2, 1.0, WISHLIST
Environment: FreeBSD, JDK6
Reporter: Peter Kostouros
Priority: Minor
The FTP server forcibly disconnects clients after about a minute of user idle
even if the user's maximum idle time setting is not exceeded.
Test case shown below:
/home/peter/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/TimeoutTest
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ftpserver.clienttests;
import java.io.ByteArrayOutputStream;
import java.io.File;
import org.apache.ftpserver.test.TestUtil;
public class TimeoutTest extends ClientTestTemplate {
private static final String TEST_FILENAME = "test.txt";
private static final File TEST_FILE = new File(ROOT_DIR, TEST_FILENAME);
private static byte[] testData = null;
private static long TIMEOUT = 120000L;
/* (non-Javadoc)
* @see org.apache.ftpserver.clienttests.ClientTestTemplate#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
testData = "TESTDATA".getBytes("UTF-8");
client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
}
public void testTimeout() throws Exception {
TestUtil.writeDataToFile(TEST_FILE, testData);
assertTrue(TEST_FILE.exists());
Thread.sleep(TIMEOUT);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
assertTrue(client.retrieveFile(TEST_FILENAME, baos));
assertTrue(TEST_FILE.exists());
TestUtil.assertArraysEqual(testData, baos.toByteArray());
}
}
Test case report:
/home/peter/ftpserver/trunk/core/target/surefire-reports/TEST-org.apache.ftpserver.clienttests.TimeoutTest.xml
org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed
without indication. at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:267)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:460) at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:520) at
org.apache.commons.net.ftp.FTP.port(FTP.java:849) at
org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:477)
at org.apache.commons.net.ftp.FTPClient.retrieveFile(FTPClient.java:1285) at
org.apache.ftpserver.clienttests.TimeoutTest.testTimeout(TimeoutTest.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
junit.framework.TestCase.runTest(TestCase.java:154) at
junit.framework.TestCase.runBare(TestCase.java:127) at
junit.framework.TestResult$1.protect(TestResult.java:106) at
junit.framework.TestResult.runProtected(TestResult.java:124) at
junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:118) at
junit.framework.TestSuite.runTest(TestSuite.java:208) at
junit.framework.TestSuite.run(TestSuite.java:203) at
sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246)
at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at
org.codehaus.surefire.Surefire.executeBattery(Surefire.java:204) at
org.codehaus.surefire.Surefire.run(Surefire.java:153) at
org.codehaus.surefire.Surefire.run(Surefire.java:77) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at
org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:303) at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at
org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at
org.codehaus.classworlds.Launcher.main(Launcher.java:375) Server ready ::
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.