php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55635 CURLOPT_BINARYTRANSFER no longer used?
Submitted: 2011-09-07 13:41 UTC Modified: 2012-11-03 04:18 UTC
From: matthijs at stdin dot nl Assigned: pierrick (profile)
Status: Closed Package: cURL related
PHP Version: trunk-SVN-2011-09-07 (SVN) OS:
Private report: No CVE-ID: None
 [2011-09-07 13:41 UTC] matthijs at stdin dot nl
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...).


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-22 09:58 UTC] pierrick@php.net
-Assigned To: +Assigned To: pierrick
 [2011-11-22 17:13 UTC] pierrick@php.net
Automatic comment from SVN on behalf of pierrick
Revision: http://svn.php.net/viewvc/?view=revision&revision=319692
Log: Fixed bug #55635
 [2011-11-22 17:16 UTC] pierrick@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2011-11-22 17:16 UTC] pierrick@php.net
-Status: Assigned +Status: To be documented
 [2012-04-18 09:47 UTC] laruence@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=php-src.git;a=commit;h=33d3eb1e43134deb3e108108f62febdabc8a0aa1
Log: Fixed bug #55635
 [2012-07-24 23:38 UTC] rasmus@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=php-src.git;a=commit;h=33d3eb1e43134deb3e108108f62febdabc8a0aa1
Log: Fixed bug #55635
 [2012-09-22 14:44 UTC] pierrick@php.net
-Type: Bug +Type: Documentation Problem
 [2012-11-03 04:18 UTC] pierrick@php.net
Automatic comment from SVN on behalf of pierrick
Revision: http://svn.php.net/viewvc/?view=revision&revision=328226
Log: Document bug #55635
 [2012-11-03 04:18 UTC] pierrick@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-11-03 04:18 UTC] pierrick@php.net
-Status: Assigned +Status: Closed
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=php-src.git;a=commit;h=33d3eb1e43134deb3e108108f62febdabc8a0aa1
Log: Fixed bug #55635
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC