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

RE: HTTPAPI (version 1.20) - Sending values longer than 256 problem.



 
Scott,

Why the +2 in:

callp   http_url_encoder_addvar( Enc
                                : NAME_V
                                : %addr(VALUE1_V) + 2
                                : %len(VALUE1_V) );


Does it have something to do with the Varying option?

Thanks,

Wouter

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, December 11, 2007 7:15 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: HTTPAPI (version 1.20) - Sending values longer than 256 problem.

Hi Jacob,

The limit is in http_url_encoder_addvar_s().   You see, I originally 
developed a routine called http_url_encoder_addvar() which doesn't have 
the limit you describe.  However, as it uses pointers for it's input, 
it's cumbersome to call.  So I decided to create a "simplified" version 
of it... that's what the _s at the end stands for -- "simplified".

the addvar_s() routine simplifies things by receiving the data as a 
VARYING string by VALUE.  (The reason it uses VALUE is because it 
changes the string in memory -- probably a poor design choice -- but 
since it's passed by value, you never see the change.)   The problem 
with VALUE is performance -- so I wanted to keep the string small to 
keep the performance from being a problem.  I figure if you need a large 
value, you can call the original addvar() routine which supports up to 
16 MB in a single call.

callp   http_url_encoder_addvar( Enc
                                : NAME_V
                                : %addr(VALUE1_V) + 2
                                : %len(VALUE1_V) );

If I could do it over again, I'd do it differently.  (For one thing, I'd 
be sure to use a shorter name for the procedures!) but calling the 
encoder_addvar() routine should solve your problem.


Jacob Christensen wrote:
> Hello !
> 
> Im new to using HTTPAPI and is having one problem with longer than
> 256 char values in the query string !
> 
> Problem. I want to use the api to send some rather long texts but
> they seams to be cut off at 256 length during the urlencoding
> process. Everything works fine - but when I investigate that data
> recived theVALUE1_V has been cut down to a length of 256 chars.
> 
> My code looks like this: (simplified.)
> 
> D Enc             s                   like(HTTP_URL_ENCODER) D
> VALUE1_V         S           8000A   Varying D NAME_V          S
> 32A   Varying
> 
> 
> 
> c                   callp     http_url_encoder_addvar_s( Enc c
> : NAME_V c                                                      :
> VALUE_V )
> 
> 
> c                   callp     http_url_encoder_getptr( Enc c
> : myPointer c                                                    :
> dataSize )
> 
> 
> c                   eval      rc = http_url_post(
>  C                               REMOTE_V
>  c                             : myPointer
>  c                             : dataSize
>  c                             : '/tmp/Sdindex.html'
>  c                             : 600
>  C                             : 'http-api/1.20'
>  C                             : 'application/x-www-form-urlencoded')
>  c                   if        rc <> 1
> 
> Is This a know limitation ? Is this a thing i can develop a fix for /
> or does a workaround exists ? 

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


= = = = = = = = = = = = = = = = = = = = = = = = =
Fortis disclaimer :
http://www.fortis.be/legal/disclaimer.htm

Privacy policy related to banking activities of Fortis:
http://www.fortis.be/legal/privacy_policy.htm
= = = = = = = = = = = = = = = = = = = = = = = = =



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