You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rw...@apache.org on 2006/01/28 18:51:59 UTC

svn commit: r373191 - /jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java

Author: rwinston
Date: Sat Jan 28 09:51:49 2006
New Revision: 373191

URL: http://svn.apache.org/viewcvs?rev=373191&view=rev
Log:
Close ServerSocket resource on IOException

Modified:
    jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java

Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java?rev=373191&r1=373190&r2=373191&view=diff
==============================================================================
--- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java Sat Jan 28 09:51:49 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2005 The Apache Software Foundation
+ * Copyright 2001-2006 The Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -499,7 +499,12 @@
             // to allow preventing the accept from blocking indefinitely.
             if (__dataTimeout >= 0)
                 server.setSoTimeout(__dataTimeout);
-            socket = server.accept();
+            try {
+				socket = server.accept();
+			} catch (IOException ioe) {
+				server.close();
+				throw ioe;
+			}
             server.close();
         }
         else



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org