[ https://issues.apache.org/jira/browse/NET-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489735 ]
Gilles Gaillard commented on NET-158: ------------------------------------- Hi Rory here is a trace of the conversation: Status: Connecting to perso-ftp.orxxxx.fr ... Status: Connected with perso-ftp.orxxxx.fr. Waiting for welcome message... Response: 220 orxxxx FTP server Command: USER xxxx Response: 331 Password required for xxxx. Command: PASS Response: 451 Pour transférer vos pages HTML sur le serveur orxxxx, vous devrez etc.. Response: 530 Login incorrect. Error: Unable to connect! After connecting, responses for SYST and FEAT: Command: SYST Response: 215 UNIX Type: L8 Command: FEAT Response: 211-Features: Response: 211-MDTM Response: 211-REST STREAM Response: 211-SIZE Response: 211 End I have implemented the change that i proposed and it works with all servers i tried (this one, Filezilla server, iis) > login in FTPClient does not always read the complete server response > -------------------------------------------------------------------- > > Key: NET-158 > URL: https://issues.apache.org/jira/browse/NET-158 > Project: Commons Net > Issue Type: Bug > Affects Versions: 1.4 > Reporter: Gilles Gaillard > Priority: Trivial > > When a password is required to connect the FTP server, the implementation of > method login in class FTPClient ends with: > return FTPReply.isPositiveCompletion(pass(password)) > which returns false for any code >= 300. > However, some servers send a code 451 before returning the code 530 > (NOT_LOGGED_IN). Ignoring this addtional answer, > leads to desynch the client with the server, hence leading to unexpected > behaviors in next exchanges. > Threfore i propose to replace the above code in the end of the method with: > _replyCode = p_Client.pass(p_Password); > boolean result = FTPReply.isPositiveCompletion(_replyCode); > if (!result && _replyCode==FTPReply.ACTION_ABORTED){ > try { > _replyCode = p_Client.getReply(); > } catch (Exception e){ > e.printStackTrace(); > } > } > return result; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]