cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl: Windows vs Mac

From: Igor Korot <ikorot01_at_gmail.com>
Date: Wed, 11 Jul 2012 16:27:48 -0700

Hi, Guenter,

On Wed, Jul 11, 2012 at 4:06 PM, Guenter <lists_at_gknw.net> wrote:
> Hi Igor,
> Am 11.07.2012 21:38, schrieb Igor Korot:
>
>> I am new to libcurl and trying to write cross-platform software having
>> problem.
>>
>> Here is my code:
>>
>> CURLcode error;
>> char errorMsg[1024];
>> wxString boundary = wxString::Format( "---------------------------%x",
>> static_cast<unsigned int>( time( NULL ) ) );
>> curl_easy_setopt( handle, CURLOPT_URL,
>> "http://174.122.236.154/TouchAndRead/Default.aspx" );
>> curl_easy_setopt( handle, CURLOPT_POSTFIELDS, const_cast<char *>(
>> boundary.ToAscii().data() ) );
>> curl_easy_setopt( handle, CURLOPT_ERRORBUFFER, errorMsg );
>> error = curl_easy_perform( handle );
>>
>> Running on Mac/Cocoa this executes fine. When ran on Windows however,
>> I am getting CURLE_WRITE_ERROR
>> and the errorMsg contains: "Failed writing body(1416 != 1460)".
>>
>> Is there some option I'm missing to set for Windows? AFAIU,
>> CURLOPT_INFILESIZE_LARGE is for files only...
>
> if that is all of your code I dont see curl_easy_init() nor
> curl_easy_cleanup() ...
> see here for a http post sample in C:
> http://curl.haxx.se/libcurl/c/http-post.html
>
> also you might have to call
> curl_global_init(CURL_GLOBAL_WIN32);

Do I have to even if I use "curl_global_init();" without any parameters?

Both "curl_easy_init()" and "curl_global_init()" are done on the app
initialization...

Thank you.

>
> see:
> http://curl.haxx.se/libcurl/c/curl_global_init.html
>
> Gün.
>
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-12