cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Debugging problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 6 Dec 2007 22:09:48 +0100 (CET)

On Thu, 6 Dec 2007, Michael Hecker wrote:

Please don't top-post: http://curl.haxx.se/mail/etiquette.html#top-post

> I found several examples for CURLOPT_DEBUGFUNCTION but all wrote the data
> directly on the screen via fprintf. I want to write the data to a string or
> CString to parse the data. How can I do that?

By setting CURLOPT_DEBUGDATA to whatever you want, like a pointer to your
private struct, and then append data to that struct in the callback.

You could find inspiration in the getinmemory.c example that does a similar
add-chunks-to-a-buffer function but for downloaded content.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-12-06