Edit report at https://bugs.php.net/bug.php?id=55635&edit=1

 ID:                 55635
 Updated by:         pierr...@php.net
 Reported by:        matthijs at stdin dot nl
 Summary:            CURLOPT_BINARYTRANSFER no longer used?
-Status:             Assigned
+Status:             To be documented
 Type:               Bug
 Package:            cURL related
 PHP Version:        trunk-SVN-2011-09-07 (SVN)
 Assigned To:        pierrick
 Block user comment: N
 Private report:     N

 New Comment:

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.




Previous Comments:
------------------------------------------------------------------------
[2011-11-22 17:13:14] pierr...@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-09-07 13:41:50] 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...).



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55635&edit=1

Reply via email to