cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

[cURLpp] Fwd: [curlpp-library] Failed to pass curl_off_t-type parameter properly

From: Jean-Philippe Barrette-LaPierre <jpb_at_rrette.com>
Date: Thu, 18 Aug 2005 16:59:10 -0400

I'm checking this right now.

-- 
Jean-Philippe Barrette-LaPierre
cURLpp maintener (http://rrette.com/curlpp.html)

attached mail follows:


Hi everybody!

I've ran into the problem, that i cann't pass curl_off_t-type parameter
to libcurl-labrary properly,
while using code snippet below:

      cURLpp::Easy request;
      request.setOpt(new
cURLpp::Options::ResumeFromLarge(cURL::curl_off_t(0)));
      // ...
      request.perform();

Considering operation's resulting verbose log, i've noticed that
CURLOPT_RESUME_FROM_LARGE option is
set to wrong value (not a zero).

I've dug a little deeper into libcurl- and curlpp-sources and found the
cause of the problem, in a OptionSetter.inl file:

-- cut --
template< typename OptionValueType,
      cURL::CURLoption optionType >
void
cURLpp::OptionSetter< OptionValueType,
              optionType >::setOpt(cURLpp::CurlHandle *handle,
                       ParamType value)
{
   handle->option(optionType, (void *)value);
}
-- cut --

As You may noticed, before to be passed to libcurl-labrary the value is
casted to (void*) type here.
I developing for 32-bit platform; environment is WindowsXP/MSVS2003.
curl_off_t type is 64-bit value here, but (void*) is 32-bit one. Such
type cast goes with a loss of data
in my case. Truncated 32-bit value will be pushed into the stack, but
further libcurl will try to extract it as 64-bit
one, that is wrong.

Used:
libcurl/7.14.0
curlpp/0.5.2

Any advise or ideas are appreciated.
I believe it is a bug in curlpp-library.

best regards

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
curlpp-library mailing list
curlpp-library_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/curlpp-library

_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2005-08-18

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET