cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: form POST problems with 64 bit Linux build ?

From: Stephen Collyer <scollyer_at_netspinner.co.uk>
Date: Thu, 17 Jul 2008 14:21:48 +0100

Michal Marek wrote:
> Stephen Collyer wrote:
>> 5. The same code works perfectly on a 32 bit Opensuse 10,3
>> installation with the same libcurl version i.e. it emits
>> the POST data as well as the header.
>>
>> So my question is: are there known POST problems with 64 bit
>> libcurl 7.16.4, and is the problem likely to go away with a
>> newer version, or have I run into something new ?
>>
>> Or is there some subtle error in the way that I'm constructing
>> the form perhaps, that hasn't shown up until now ?
>
> Likely. Make sure that you are passing longs where the documentation
> tells you so.

I guess "likely" refers to my subtle error, rather than a 64 bit libcurl
problem.

Anyway, I see a potential problem:

I'm calling curl_formadd like so:

> curl_formadd(&formpost,
> &lastptr,
> CURLFORM_COPYNAME, element_name.data(),
> CURLFORM_NAMELENGTH, element_name.size(),
> CURLFORM_COPYCONTENTS, element_contents.data(),
> CURLFORM_CONTENTSLENGTH, element_contents.size(),
> CURLFORM_END);

and the Qt size() methods return an int. However, it's
just occurred to me that curl_formadd is a varargs fn,
so I guess I need explicit casts to long to make sure this
works reliably across different architectures.

I'm not yet sure that that is the problem but it's clearly
worth trying.

-- 
Regards
Steve Collyer
Netspinner Ltd
Received on 2008-07-17