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

From: Date: Tue, 15 Oct 2013 11:54:37 +0000
Subject: Bug #64247 [Fbk->NoF]: CURLOPT_INFILE doesn't allow reset for FTP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182223@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:       php-bugs@lists.php.net
 Reported by:      marco at m-s-d dot eu
 Summary:          CURLOPT_INFILE doesn't allow reset for FTP
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          cURL related
 Operating System: Linux 3.0.0-1-amd64 #1 SMP
 PHP Version:      master-Git-2013-02-19 (Git)
 Private report:   N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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


Thread (5 messages)

« previous php.bugs (#182223) next »