curl / Mailing Lists / curl-library / Single Mail

curl-library

Usage of CURLOPT_ERRORBUFFER

From: Martin Galvan via curl-library <curl-library_at_cool.haxx.se>
Date: Sat, 23 Dec 2017 16:02:54 -0300

Hi all,

The docs for CURLOPT_ERRORBUFFER say:

"You must keep the associated buffer available until libcurl no longer
needs it. Failing to do so will cause very odd behavior or even
crashes. libcurl will need it until you call curl_easy_cleanup or you
set the same option again to use a different pointer. "

While this is an odd design choice, I wonder what "keeping the buffer
available" means in this context. Does it mean that it should remain
allocated, or that its contents shouldn't be touched? What happens if
I want to make multiple requests using the same bufffer, and zero it
before each request? Should I call curl_easy_cleanup, then
curl_easy_init again before each new request?
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-12-23