ID:               45161
 Updated by:       j...@php.net
 Reported By:      humbads at alum dot mit dot edu
-Status:           Open
+Status:           Closed
 Bug Type:         cURL related
 Operating System: *
 PHP Version:      5CVS, 6CVS (2008-12-08)
 New Comment:

This bug has been fixed in CVS.

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:
------------------------------------------------------------------------

[2008-12-11 13:51:12] magical...@php.net

This patch will get rid of to_free.str if libcurl version is >= 7.17.0

Also:

[09:25:46] <MT`AwAy> btw curl doc says: "curl_slist_append() copies the
string.", is this true for all versions of libcurl ?
[09:26:33] <B4gder> yes

So, code duplicating strings before passing them to curl_slist_append()
has been completly removed.

http://ookoo.org/svn/snip/php_bug45161_curl_textcopy.patch

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

[2008-12-11 06:03:56] magical...@php.net

Hi,

Managed to get rid of to_free.str, with one exception bugging me: when
we call curl_slist_append(), we duplicate the string before, however
curl doc says: "curl_slist_append() copies the string."

Is this true with all versions of curl? I see nothing written about
this in the curl man page.

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

[2008-10-28 22:25:04] j...@php.net

I have no time to spend on this right now.

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

[2008-08-15 15:37:26] j...@php.net

FYI: This is by design in any resource in PHP. Freeing happens in the
request shutdown. Just do unset($ch); in the end of the for loop and $ch
= curl_init(); in the start of the loop and you get "static" memory
usage. 

I'm going to only look at what Daniel pointed out and make PHP not
duplicate unnecessarily if curl version is >= 7.17.0.

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

[2008-06-22 22:06:30] daniel at haxx dot se

I could also add that libcurl does duplicate the input strings since a
few versions back (since libcurl 7.17.0), so if such a recent version of
libcurl is detected there's no reason at all for PHP to keep copies.

This goes for everything except CURLOPT_POSTFIELDS which isn't
duplicated for backwards compatiblity reasons, but that one can then be
replaced with CURLOPT_COPYPOSTFIELDS which does copy.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/45161

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

Reply via email to