From: Operating system: PHP version: trunk-SVN-2011-09-07 (SVN) Package: cURL related Bug Type: Bug Bug description:CURLOPT_BINARYTRANSFER no longer used?
Description: ------------ While trying to find out what CURLOPT_BINARYTRANSFER did exactly, I found that it isn't used at all. I looked around in the ext/curl directory in trunk for uses of the PHP_CURL_BINARY and PHP_CURL_ASCII constants, and found that they're only used for setting the ch->handlers->write->type value, but this value is never used anywhere. It seems the last use of the constants has disappeared in r211314 ("fix bug #37061 (curl_exec() doesn't zero-terminate binary strings) - we get the data length from cURL, so it's binary safe. fix leak appearing when re-using curl handle"). I'm not 100% sure my analysis is correct, but if it is, I guess the (code for) the option should be removed and the documentation updated. there's no need for them to be zero-terminated It actually makes sense not to distinguish between binary and non-binary results: A normal string is just a special case of binary string, so always returning a "binary string" should work just fine. AFAIK strings always have a length associated with them, so zero bytes could occur within any PHP string (it's just that using strings with zero bytes in them don't always work with external C functions that expect zero terminated strings...). -- Edit bug report at https://bugs.php.net/bug.php?id=55635&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55635&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55635&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55635&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55635&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55635&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55635&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55635&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55635&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55635&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55635&r=support Expected behavior: https://bugs.php.net/fix.php?id=55635&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55635&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55635&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55635&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55635&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55635&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55635&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55635&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55635&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55635&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55635&r=mysqlcfg