Unlike I initially though, I need to save the header in a file. As I 
experienced, the line
 
curl_easy_setopt(sessionA, CURLOPT_WRITEHEADER, HeaderFile); 
 
corrupts the initialization of the data structure the user gives to 
CURLOPT_WRITEDATA in order to have the write-back function writing in it.
 
The evidence of that happening is visible by running the "getinmemory.c" 
program I modified slightly and posted on June 4th here: 
http://curl.haxx.se/mail/lib-2011-06/0028.html
 
If I run it without that incriminated line, it works fine. If I add that line, 
it goes in segmentation fault.
 
Is there a specific reason for this behavior? How can I have the header saved 
on file?
 
Thank You...
 


Date: Sun, 5 Jun 2011 09:58:34 -0700




BS>> curl_easy_setopt(sessionA, CURLOPT_WRITEDATA, NULLFILE); 
BS>> curl_easy_setopt(sessionA, CURLOPT_WRITEHEADER, HeaderFile); 
BS>> I had better luck without this stuff. Perhaps you don't want to do 
CURLOPT_WRITEDATA twice.
 
Brad... Your hint was precious. I checked, tested an retested:
 
It's the CURLOPT_WRITEHEADER that corrupts the initialization of the user 
data_struct. If I comment that line, the getinmemory.c works just fine. NO 
segmentation fault!
 
The first CURLOPT_WRITEDATA to /dev/null does not make any trouble. And I need 
it.
 
As second thought, I may not need to store the header and just remove that line.
 
I want to thank all of you guys.
                                          
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to