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

Re: http_url_get problem



Sorry, Mike... you're not quite correct here.

The encoded data is not in a 1000A variable, therefore the data that's in his "req" variable is "unpredictable". It could be x'00' if the data after the part he's actually using happens to be unused memory, then this is the most likely case. But, it could contain other byte values as well. You're right that the length of URL is 1000A, but the length of the data that "req" points to is not -- and you should not assume that it will be padded with any particular character.

This is why http_url_encoder_getptr() returns the length of the data -- so that the caller doesn't need to just blatantly assume that it'll be some length (like 1000), but rather is explicitly told what the length is. So that you don't have to guess what's in adjacent memory locations!

-SK


On 11/29/2012 11:46 AM, Mike Krebs wrote:
Well, I built the parameter part of the string with the function "http_url_encoder_addvar_s", maybe the problem is there?
The way you retrieved the data is a problem. REQ does not have blanks in it. Therefore an ordinary %trim is leaving x'00' attached. The length of URL is 1000 and the %trim has no effect.

One fix is this:

url = %trim(url) + %trimr(req:x'00');



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------