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

Re: Post vs Post_raw



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


Yes, you are correct, we do not need the data returned. Thanks for simplifying the procedure for us. We reran the changed program and got the same results
DSPLY recvdoc: saveproc: Not all data was written!
in the joblog.

This error means that the return value from your "incoming" subprocedure was smaller than the value of the 3rd parameter. i.e. 'datalen' in your example.


The procedure that I posted actually returns the same value as the input parameter -- yet you're getting an error that states that the value you're returning is smaller than the input parameter, which does not make sense.

Here's the relevant code from HTTPAPIR4:

c                   eval      rc = saveproc( peFD
c                                          : %addr(wwData)
c                                          : wwLen )
c                   if        rc < wwLen
c                   callp     SetError(HTTP_RDWERR:'recvdoc: saveproc:'
c                              ' Not all data was written!')
c                   return    -1
c                   endif

'saveproc' is calling the procedure pointer tht you passed to http_url_post_raw() -- in the code you posted, it said %paddr('INCOMING') which means you're passing the address of the incoming subprocedure. So, saveproc() will call that subprocedure.

It passes you the same peFD parm that you passed to url_post_raw(), the data that was received, and the length of the data that was received.

Then, it signals an error if the value you returned is less than the value it passed in the 3rd parm. So, the code is really very simple -- your return value is somehow smaller than the value it's passing for the 3rd parm.


FYI, the datalen variable is equal to 0



This procedure is called (potentially) many times. Each time might have a different 'datalen' value. You have to make sure you're returning the same value that it passed in the 3rd parm. If that value is 0, then you need to return zero.



Right now, I'm not sure which side (iSeries or Web) is causing the problem.

This is clearly a problem on the iSeries, either with your INCOMING procedure, or with the RECVDOC procedure in HTTPAPI. This particular error cannot be caused by the web server. (Though, it may be hiding a different error...)


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------