On Wed, Feb 17, 2010 at 8:39 PM, DevNull 43 <[email protected]> wrote:
> While implementing a site command, for example extending "site help", the
> return StringBuffer.toString() IE:
>
>        session.write(new DefaultFtpReply(FtpReply.REPLY_200_COMMAND_OKAY,
> sb.toString()));
>
> does not reply a:
>
> 200- Line1
> 200- Line2
> 200- Line3
> ftp>
>
> Instead the response is as:
>
> 200-
> Line1
> Line2
> 200- Line3

According to the RFC, a multiline reply should be formatted as:
123-First line
Second line
123 The last line

Which is what we currently do (there are a few test cases in
org.apache.ftpserver.impl.DefaultFtpReplyTest that attempts to verify
this).

However, reading the RFC on this just now, I found we do have a bug
where we do not correctly handle lines beginning with a number, for
example from the RFC:
123-First line
Second line
  234 A line beginning with numbers
123 The last line

I've created a patch for this and will open a JIRA issue for trunk and 1.0.4.

Now, if you really want to return reply codes on every line, despite
what the RFC says, you would have to implement your own reply class.

/niklas

Reply via email to