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

Re: [Ftpapi] RECVCHUNK error



Most likely the answer can be found in HTTPAPIR4:

 

     C* Write any received data to the save procedure:                                             

     C                   if        RDWR_Writer_p <> *null                                           

     C                   eval      rc = Writer_write( RDWR_Writer_p                                 

     C                                              : %addr(wwData)                                 

     C                                              : wwRecSize )                                   

     C                   else                                                                       

     c                   eval      rc = saveproc( peFD                                              

     c                                          : %addr(wwData)                                     

     c                                          : wwRecSize)                                        

     c                   endif                                                                      

                                                                                                    

     c                   if        rc < wwRecSize                                                   

     c                   callp     SetError(HTTP_RDWERR:'recvchunk: saveproc:'+                     

     c                              ' Not all data was written!')                                   

     c                   return    -1                                                               

     c                   endif                                                                      

 

“saveproc” equals to your procedure “receiveProc”. It must return the number of bytes received. If it receiced less bytes than expected, it returns the “Not all data was written” error.

 

Now the key is that your “receiveBuffer” is 32767 bytes. But the total amount of data received is 36389 bytes (16093 + 16376 + 3920). Since your buffer is too small, .” receiveProc” returned 298 instead of 3920 bytes on the last call and triggered the error:

 

  24500        If (receiveBuffer.size + length > %Len(receiveBuffer.data));

  24600  ==>      Size = %Len(receiveBuffer.data) - receiveBuffer.size;   <==

  24700        Else;

  24800           Size = Length;

  24900        EndIf;

 

Thomas.

 

 

Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Tony Cesarios
Gesendet: Dienstag, 22. Mai 2018 04:53
An: 'FTPAPI/HTTPAPI mailing list'
Betreff: [Ftpapi] RECVCHUNK error

 

Hi,

 

Using HTTP_URL_GET_RAW I’ve adjusted my program to use xlatedyn because of the size of data. However I now get “recvchunk: saveproc: Not all data was written” error.

 

Have attached copy of the program and also the debug dump.

 

Regards

 

tonyletterhead2

 

--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi