cURL / Mailing Lists / curl-library / Single Mail


Re: Unable to get content when using libcurl as staticlibrary in dll

From: Daniel Stenberg <>
Date: Sat, 18 Aug 2012 23:31:40 +0200 (CEST)

On Fri, 17 Aug 2012, Saravana kumar wrote:

> the exported function returns CURLCode 23, which was
> write function error! Am i missing anything?

Yes. You forgot to read the docs properly....

> /* the function to invoke as the data recieved */
> size_t static write_callback_func(void *buffer, size_t size, size_t
> nmemb, void *userp)
> {
> char **response_ptr = (char**)userp;
> /* assuming the response is a string */
> *response_ptr = strndup(buffer, (size_t)(size *nmemb));
> }

First, didn't your compiler warn you about not returning anything from this

Then, a little clue from

  "Return the number of bytes actually taken care of. If that amount differs
   from the amount passed to your function, it'll signal an error to the
   library. This will abort the transfer and return CURLE_WRITE_ERROR."

List admin:
Received on 2012-08-18