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

FTPAPIR4 not returning all lines of an FTP command reply



   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
-----------------------------------------------------------------------