cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Unhandled exceptionwhenusingcurl_easy_perform()inVisualStudio2005 on Windows XP.

From: Xu Xiaogang-a19881 <nickxu_at_motorola.com>
Date: Thu, 5 Jun 2008 10:36:16 +0800

Thanks a lot for your help. It can work now.

Regards
-Xiaogang

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Nathan E. Moore
Sent: 2008Äê6ÔÂ4ÈÕ 20:55
To: libcurl development
Subject: RE: Unhandled exceptionwhenusingcurl_easy_perform()inVisualStudio2005 on Windows XP.

--On Wednesday, June 04, 2008 4:30 PM +0800 Xu Xiaogang-a19881 <nickxu_at_motorola.com> wrote:
>
> CURLcode setPostField(string post_content)
> {
> CURLcode errornum;
> errornum = curl_easy_setopt (curl, CURLOPT_POSTFIELDS,
> post_content.c_str());
>
> if (errornum != CURLE_OK)
> {
> throw curl_easy_strerror(errornum);
> }
>
> return CURLE_OK;
> }
>

With the current version your problem is here. The CURLOPT_POSTFIELDS option does NOT copy the buffer. You should try switching to CURLOPT_COPYPOSTFIELDS as it does copy the data.

Nathan Moore
Received on 2008-06-05