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

Re: [Ftpapi] HTTP_URL_GET_RAW



Scott,
Thank you ... I'll look at the code.

Joe

Sent from my iPhone

On May 19, 2017, at 8:18 PM, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:

Hello,

This routine returns it's output via a callback procedure.  Each time data arrives on the network, it calls the procedure again.    So you might get 100 bytes the first call, 345 the second call, 800 on the third call...  the amount you get on each call depends on the speed of your network, the way your packets are configured, which other networks it goes through to get to yours, and how they are all configured.  You should never expect to get all data in a single call!  If the sender has sent 3000 bytes, the callback will be run repeatedly, each time with a different amount, until the total bytes has added up to 3000  It is your job to save the data and put it all together.  That is why it is called "raw".

I've never heard of it losing any data in the 16 years that HTTPAPI has been available.   I would strongly recommend that you check your callback logic carefully, because I think most likely the data that's missing is due to an error in your code.

If I were you, I'd consider using http_string() or http_req() instead so that you don't have to do the work yourself, unless you have a good reason to process the raw data as it's arriving over the network?

-SK


On 5/17/17 5:27 PM, Joseph C. Mauro wrote:

I am using this API to get data from a WEB site in RPGLE on a system i release 7.1. The connection is successful and data is received but the data received is truncated with the first 50-60 bytes eliminated. In addition, while the website is sending over 3,000 characters of data, the data length in the receive data procedure is 345. The data actually received (even with the first 50-60 characters missing) is far greater than that.

 

Any ideas as to what may be causing this problem?

 

Thank you,

Joe Mauro

 

Sent from Mail for Windows 10

 




--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi