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 2004/12/13 12:32:29 UTC

cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp FTP.java

rwinston    2004/12/13 03:32:27

  Modified:    net/src/java/org/apache/commons/net/ftp FTP.java
  Log:
  Applied patch from PR 31793
  
  Revision  Changes    Path
  1.18      +16 -1     jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FTP.java	5 Oct 2004 17:40:24 -0000	1.17
  +++ FTP.java	13 Dec 2004 11:32:27 -0000	1.18
  @@ -20,6 +20,7 @@
   import java.io.InputStreamReader;
   import java.io.OutputStreamWriter;
   import java.net.InetAddress;
  +import java.net.SocketException;
   import java.util.Enumeration;
   import java.util.Vector;
   import org.apache.commons.net.MalformedServerReplyException;
  @@ -432,8 +433,22 @@
           }
           __commandBuffer.append(SocketClient.NETASCII_EOL);
   
  -        _controlOutput.write(message = __commandBuffer.toString());
  +        try{
  +	    _controlOutput.write(message = __commandBuffer.toString());
           _controlOutput.flush();
  +        }
  +        catch (SocketException e)
  +        {
  +            if (!isConnected() || _socket_ == null || !_socket_.isConnected())
  +            {
  +                throw new FTPConnectionClosedException("Connection unexpectedly closed.");
  +            }
  +            else
  +            {
  +                throw e;
  +            }
  +        }
  +	
   
           if (_commandSupport_.getListenerCount() > 0)
               _commandSupport_.fireCommandSent(command, message);
  
  
  

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