[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FTPAPIR4 not returning all lines of an FTP command reply



hi Simon,

If I'm reading it right, your change would return the first and last 
line of the response.  So a response like this:

220- Welcome to Acme's FTP server
220- We sure are glad to have you here
220  Have a nice day.

Would set peRespMsg = 'Welcome to Acme's FTP server / Have a nice day'

Correct?  Shouldn't your change be inside the loop so it's repeated for 
every line of the response?


On 5/16/2011 7:36 AM, Simon Scott wrote:
>
>     All,
>
>
>     I've made a small change to FTPAPIR4 to handle FTP command replies
>     that are longer than one line.
>
>
>     Here's the relevant part of the existing `reply' subprocedure:
>
>
>          * If this is a single line reply, we're done.
>
>      B01 c                   if        %subst(wwLine:4:1)<>  '-'
>
>          c                   return    wwReply
>
>      E01 c                   endif
>
>
>           * If not, get all lines of reply
>
>      B01 c                   dou       wwNum = wwReply
>
>          c                               and %subst(wwLine:4:1)<>  '-'
>
>      B02 c                   if        RecvLine(peSocket: wwLine)<  0
>
>          c                   return    -1
>
>      E02 c                   endif
>
>          c                   movel     wwLine        wwChar3
>
>          c                   testn                   wwChar3
>     99
>
>          c   99              move      wwChar3       wwNum
>
>          c  N99              eval      wwNum = 0
>
>      E01 c                   enddo
>
>
>          c                   return    wwReply
>
>          P                 E
>
>
>     This gets the extra lines successfully but does not put them into the
>     so I added the following immediately above the `return' statement:
>
>
>       * Also set ALL of the response message, again, only if required
>
>      c                   if        %parms>  1
>
>      c                   eval      peRespMsg = %Trim(peRespMsg) + ' / '
>
>      c                                         + %subst(wwLine:5)
>
>      c                   endif
>
>      c                   enddo
>
>
>
>     Regards
>
>
>     Simon Scott
>
>       _________________________________________________________________
>
>     NOTICE: The information in this electronic mail transmission is
>     intended by CoralTree Systems Ltd for the use of the named individuals
>     or entity to which it is directed and may contain information that is
>     privileged or otherwise confidential. If you have received this
>     electronic mail transmission in error, please delete it from your
>     system without copying or forwarding it, and notify the sender of the
>     error by reply email or by telephone, so that the sender's address
>     records can be corrected.
>     ----------------------------------------------------------------------
>     ----------
>     CoralTree Systems Limited
>     25 Barnes Wallis Road
>     Segensworth East, Fareham
>     PO15 5TT
>     Company Registration Number 5021022.
>     Registered Office:
>     12-14 Carlton Place
>     Southampton, UK
>     SO15 2EA
>     VAT Registration Number 834 1020 74.
>
>
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------