Bug #64247 [NoF->Asn]: CURLOPT_INFILE doesn't allow reset for FTP

From: Date: Tue, 29 Apr 2014 08:03:46 +0000
Subject: Bug #64247 [NoF->Asn]: CURLOPT_INFILE doesn't allow reset for FTP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185492@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64247&edit=1 ID: 64247 Updated by: mike@php.net Reported by: marco at m-s-d dot eu Summary: CURLOPT_INFILE doesn't allow reset for FTP -Status: No Feedback +Status: Assigned Type: Bug Package: cURL related Operating System: Linux 3.0.0-1-amd64 #1 SMP PHP Version: master-Git-2013-02-19 (Git) Assigned To: mike Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2013-10-15 11:54:37] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. ------------------------------------------------------------------------ [2013-06-16 23:46:50] stas@php.net Please add a test to the patch. ------------------------------------------------------------------------ [2013-02-19 20:43:38] marco at m-s-d dot eu Description: ------------ When trying to do a PUT request using CURLOPT_INFILE followed by a GET, then the GET will encounter a "Warning: curl_setopt_array(): supplied argument is not a valid File-Handle resource" if the file handle has been closed. This is a bug because you're supposed to free handles when you're not using them. Setting NULL like with CURLOPT_HEADERFUNCTION (see http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHEADERFUNCTION) does not work, it gives "Warning: curl_setopt_array(): supplied argument is not a valid File-Handle resource". See also Bug #44866 - leaking FDs is bad, bad program practice. Test script: --------------- http://pastebin.com/XLJsZ9JH - line 44 is the CURLOPT_INFILE=>NULL line. Expected result: ---------------- Once CURLOPT_INFILE=>NULL has been set, I expect that the action of setting CURLOPT_INFILE=>$fp has been reversed (i.e. that curl has been reset to default), ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64247&edit=1

« previous php.bugs (#185492) next »