cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURL_EASY_PERFORM error but data transfer works

From: Jon <jon_at_mobilefs.com>
Date: Wed, 18 Feb 2015 22:43:10 -0500

Hello all,

 

Hello all,

 

In the following simple code below, I get a CURLE_WRITE_ERROR (23) on the
return of the CURL_EASY_PERFORM function. This looks like a serious error
(error text = failed writing received data to disk/application) however the
data successfully was sent and received by the URL.

 

I have tested this on multiple occasions with the same error but yet things
continue to work. Is this a documented benign error and/or can I ignore it?
Or does it signal something more serious? Am I missing a setup call?

 

Function call (please note that I took out a real phone # for this email):

 

curl_out("phone=1234567890_at_txt.att.net&message=This is a test.",
"testpage2");

 

Function as defined in my module:

 

int CClient2Dlg::curl_out(char *curlstring, char *url)

{

   CURL *curl;

   CURLcode res;

   char buff[160], urlbuff[160];

 

 

   /* In windows, this will init the winsock stuff */

   curl_global_init(CURL_GLOBAL_ALL);

 

   /* get a curl handle */

   curl = curl_easy_init();

   if(curl) {

      sprintf(urlbuff,"http://www.keyonsec.com/%s", url);

      curl_easy_setopt(curl, CURLOPT_URL, urlbuff);

      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, curlstring);

      res = curl_easy_perform(curl);

      if(res != CURLE_OK) {

         sprintf(buff, "Error: CURL send failed (%s). Database has not been
populated.", curl_easy_strerror(res));

         MessageBox(buff, "Error", MB_OK);

      }

      

      /* cleanup */

      curl_easy_cleanup(curl);

   }

   

   curl_global_cleanup();

   return(1);

}

 

 

Thanks,

Jon

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-02-19