commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NET-474) Problem, in __getReply method, parsing reply code with leading space
Date Wed, 11 Jul 2012 00:01:59 GMT

    [ https://issues.apache.org/jira/browse/NET-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411079#comment-13411079
] 

Sebb commented on NET-474:
--------------------------

Here is a sample session to a recent version of the server:

{noformat}
Connected to ftp.ipswitch.com.
220 ftp6.ipswitch.com X2 WS_FTP Server 7.5.1(76307814)
331 Enter password
230 User logged in
Remote system type is UNIX.
ftp> quote stat
211-System status Ipswitch FTP Server
 Version WS_FTP Server 7.5.1
 Connected to 192.168.100.130
 Logged in as anonymous
 TYPE: BINARY, FORM: Nonprint; STRUcture: File; transfer MODE: STREAM
 No data connection
211 End of status
ftp> bye
221 bye
{noformat}

Note that the reply codes start in column 1 (index 0).
                
> Problem, in __getReply method, parsing reply code with leading space
> --------------------------------------------------------------------
>
>                 Key: NET-474
>                 URL: https://issues.apache.org/jira/browse/NET-474
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.1
>         Environment: UNIX
>            Reporter: Ahmad AMIN
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> FTPClient.getStatus() function call failed complaining about malformed response code.
> After tracing the code, I found the problem at following class and line:
> *org.apache.commons.net.ftp.FTP.__getReply(FTP.java:333)*
> The issue is that this method always expects reply code at position 0 of the returned
reply string. If the reply string has some leading spaces, it fails to parse the reply code
and returns malformed reply string.
> Example of such a reply string:
> {noformat}
>       211-nhpssltest Ipswitch FTP Server
>       Version 5.0.2
>       Connected to 184.70.132.130
>       Logged in as massba
>       TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: STREAM
>       No data connection
> 211 End of status
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message