Tim -- If you use new() to create something, you can't use free() to delete it. Use delete. That's probably what's screwing you up.
-Josh -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Gross, Tim (Utility Computing Architect) Sent: Monday, September 21, 2009 11:47 AM To: libcurl development Subject: RE: UTF8_CONVERSION_ERROR_NEGATIVE failure Daniel, I think I have figured out the problem. I do the following, prior to the curl_easy_perform() call: char *temp_url = new char[100]; strcpy(temp_url, "http://myserver.com/whatever.cgi"); cURLres = curl_easy_setopt(m_curl, CURLOPT_URL, temp_url); free(temp_url); >From the documentation for curl_easy_setopt(), it appears that the third >parameter (in my code temp_url) is copied and therefore it is safe to >deallocate it after the call to curl_easy_setopt(). But this yields the >failure that I described in my initial message. It seems the problem is that >the url is not valid when I invoke the curl_easy_perform() API. Furthermore, when I comment out the "free(temp_url)" statement, it is successful. This is contrary to the documentation, but seems to be the fix. Can you confirm this? I am using version 7.19.4 on RHEL 5.1. I download the RPM. Thanks, Tim. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Stenberg Sent: Monday, September 21, 2009 12:24 AM To: libcurl development Subject: Re: UTF8_CONVERSION_ERROR_NEGATIVE failure On Sun, 20 Sep 2009, Gross, Tim (Utility Computing Architect) wrote: > When I do a curl_easy_perform(), it always fails. > > res = curl_easy_perform(m_curl); > > if(res != CURLE_OK) > { > printf("Detailed CURL error: %s\n",sDetailedErrorInfo); > } > > Sometimes this prints out UTF8_CONVERSION_ERROR_NEGATIVE and sometimes > it has garbage characters in it. Has anybody seen this before? What libcurl version on what OS? Did you build the lib yourself or did you get a prebuilt version from somewhere? How is 'sDetailedErrorInfo' populated? -- / daniel.haxx.se
