cURL / Mailing Lists / curl-library / Single Mail


RE: FILE errno -1 & Bad file descriptor error

From: Phil Freeman <>
Date: Sun, 5 Apr 2015 20:34:53 +1000

After the curl_easy_perform() is called, I can still print data from fp. Something like:



GePrint("fp->_base: " + String(fp->_base));
GePrint("fp->_bufsiz: " + LongToString(fp->_bufsiz));
GePrint("fp->_charbuf: " + LongToString(fp->_charbuf));
GePrint("fp->_cnt: " + LongToString(fp->_cnt));
GePrint("fp->_file: " + LongToString(fp->_file));
GePrint("fp->_flag: " + LongToString(fp->_flag));
GePrint("fp->_ptr: " + LongToString(*fp->_ptr));

int fclo = fclose(fp); <-- error


I had previously printed the text from the file itself, which worked fine. But the problem I face is that in the final application, I'll be needing to download something that isn't a text file. But at my end at least, the file still appears to be valid after the curl_easy_perform() function, but for whatever reason the calling of this function causes fclose() to fail?

Date: Wed, 1 Apr 2015 15:10:22 +0200
Subject: Re:FILE errno -1 & Bad file descriptor error

On Wed, 1 Apr 2015, 兰天 wrote:

> Here , this error indicate that the fd has been closed before, so here means
> close the same fd two times. I suffer the similar problem ,however I do not
> find the solution!

Since libcurl doesn't close it any of those times, I would suspect the logic
provided by the application...

------------------------------------------------------------------- List admin: Etiquette: 		 	   		  
List admin:
Received on 2015-04-05