curl-library
http headers free and multi
Date: Tue, 10 Oct 2006 15:29:45 +0200
Hello,
When I use the multi mode and http POST, I have to do something like that:
struct curl_slist *headers=NULL;
headers = curl_slist_append(headers, "Content-Type: text/xml");
curl_easy_setopt(easy_handle, CURLOPT_HTTPHEADER, headers);
The problem is when to call
curl_slist_free_all(headers)
I cannot call it before I add the easy handle to the multi and perform,
because the easy handle does not copy the list (instead, it uses the headers
pointer)
On the other hand, I don't have an access to the internal headers list from
the easy handle after the request is finished.
I have 2 solutions (I don't like them very much):
1. access the headers from the easy handle after the request ended using my
own mapping between the easy handle and its headers.
2. use the curl_easy_getinfo with CURLINFO_PRIVATE after request is finished
(when the private data is the headers)
Can you advice me of a more elegant solution other then those?
Received on 2006-10-10