Bug #64247 [NEW]: CURLOPT_INFILE doesn't allow reset for FTP
From: marco at m-s-d dot eu
Operating system: Linux 3.0.0-1-amd64 #1 SMP
PHP version: master-Git-2013-02-19 (Git)
Package: cURL related
Bug Type: Bug
Bug description:CURLOPT_INFILE doesn't allow reset for FTP
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 bug report at https://bugs.php.net/bug.php?id=64247&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64247&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64247&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64247&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64247&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64247&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64247&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64247&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64247&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64247&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64247&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64247&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64247&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64247&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64247&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64247&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64247&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64247&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64247&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64247&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64247&r=mysqlcfg
Thread (5 messages)
- marco at m-s-d dot eu