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

Re: Allocation error in HTTPAPI



Hi Rick,

XALLOC() is called from many places within HTTPAPI, so unfortunately 
telling me that XALLOC is returning an error doesn't give me much 
information.

You say that ContLen() is approx 4.2 billion.  That's nice, but I don't 
know how ContLen() corresponds to the length that's being allocated?!

You show some code related to a user space.  If ContLen is 4.2 billion, 
how can you use it with a user space?  (User spaces are limited to 16 
MB!)  I'm lost.


On 6/1/2010 7:01 AM, Rick Bovet wrote:
>
>     Hello all,
>
>
>     Occasionally I get an allocation error while parsing a xml-document. I
>     believe it occurs when a large request (document) is being parsed.
>
>     I read in the documentation that there is a TERASPACE compile option
>     when generating HTTPAPI, but that is disabled for compatibility
>     reasons in EXPAT. I am not sure this compile option will solve my
>     problem though. I am running version 1.23 of HTTPAPI.
>
>
>     Here is a snippit of my code:
>
>     ...
>
>     len = ContLen();
>
>     UsrSpcNam = crtusrspc( UsrSpcLib : p2Space : qusei : '*ALL' : '' : le
>
>     UsrSpcReq = UsrSpc;
>
>
>     readIn( Workarea : len : inLen : Qusec );
>
>
>     InvalidRequest = *On;
>
>     // parse xml
>
>     http_XmlReturnPtr(*ON);
>
>     if (http_parse_xml_string( p2Space : inLen
>
>                            : 0
>
>                            : *NULL
>
>                            : %paddr(EndTag)
>
>                            : *null )<  0 );
>
>        MessageReturn  = http_error();
>
>        InvalidRequest = *Off;
>
>     endif;
>
>     ...
>
>
>     From the dump I generated after the MSGW in XALLOC it shows that my
>     ContLen() = 4.213.172. I read the entire request into a *USRSPC and I
>     pass the pointer to the userspace and the length to
>     http_parse_xml_string.
>
>
>     I use this method to send a flat file from one as/400 to another
>     as/400 (excuse the old name). The file/data is base64 encoded and
>     between two xml-tags. So the entire file is one XML-element. Probably
>     this was a large file.
>
>
>     Any hints on solving this problem...
>
>
>
>     Rick Bovet
>
>     Development Manager
>
>     Siriusdreef 66, 2132 WT  Hoofddorp
>
>     Postbus 3005, 2130 KA  Hoofddorp
>
>     The Netherlands
>
>     [1]rbovet@xxxxxxxxxxxxxxxx
>
>
>     [2]ECi-Software Solutions-sm_signature
>
> References
>
>     1. file://localhost/tmp/rbovet@xxxxxxxxxxxxxxxx
>     2. http://www.ecisolutions.com/
>
>
>
>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------