Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 80CF0DF7D for ; Tue, 10 Jul 2012 18:04:37 +0000 (UTC) Received: (qmail 50888 invoked by uid 500); 10 Jul 2012 18:04:37 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 50777 invoked by uid 500); 10 Jul 2012 18:04:37 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 50617 invoked by uid 99); 10 Jul 2012 18:04:36 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 18:04:36 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id D01BE141BF8 for ; Tue, 10 Jul 2012 18:04:36 +0000 (UTC) Date: Tue, 10 Jul 2012 18:04:36 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: <727180611.29891.1341943476854.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1041959558.24757.1341862534683.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (NET-474) Problem, in __getReply method, parsing reply code with leading space MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NET-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13410640#comment-13410640 ] Sebb commented on NET-474: -------------------------- This is the first and only report of a server that apparently sends leading spaces. IMO adding lenient processing is overkill/unnecessary feature creep. If it really is a genuine problem affecting more than 1 specific server version then it might be worth allowing __getReply to be overridden, as that is probably the easiest solution. > 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 > Fix For: 3.2 > > 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