Issue Details (XML | Word | Printable)

Key: NET-33
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Tegbir Singh DHILLON
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] __openDataConnection does not close ServerSocket after server.accept() timesout

Created: 25/Jan/06 09:58 PM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: All

Bugzilla Id: 38381


 Description  « Hide
In org.apache.commons.net.ftp.FTPClient
in method "protected Socket openDataConnection(int command, String arg) throws
IOException" after server.accept() times out, it leaves the socket open in
listening mode and just progates the exception. It should close the socket
before propogating the exception.

// For now, let's just use the data timeout value for waiting for
// the data connection. It may be desirable to let this be a
// separately configurable value. In any case, we really want
// to allow preventing the accept from blocking indefinitely.
if (__dataTimeout >= 0)
server.setSoTimeout(__dataTimeout);
try{ socket = server.accept(); }catch(SocketTimeoutException ste){ server.close(); throw ste; }
server.close();
}
else
{ .....
.....



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rory Winston added a comment - 29/Jan/06 02:52 AM
Added a catch-and-rethrow that closes the ServerSocket before rethrowing.