#48208 [NoF->Fbk]: curl_copy_handle() loses CURLOPT_POSTFIELDS option after original is closed

From: Date: Tue, 15 Dec 2009 00:42:39 +0000
Subject: #48208 [NoF->Fbk]: curl_copy_handle() loses CURLOPT_POSTFIELDS option after original is closed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-145730@lists.php.net to get a copy of this message
ID: 48208 Updated by: felipe@php.net Reported By: rick at meritos dot nl -Status: No Feedback +Status: Feedback Bug Type: cURL related Operating System: Linux PHP Version: 5.3.0RC2 Assigned To: pajoye New Comment: Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2009-05-18 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2009-05-10 16:24:38] jani@php.net I wanted to know if this happens also in PHP_5_2 branch so we you don't go and fix stuff only in PHP_5_3.. ------------------------------------------------------------------------ [2009-05-10 08:43:52] pajoye@php.net Please do not ask generecally to try a snapshot when they use the freshly release RC2 :) I have to verify why curl_easy_duphandle does not copy the POST data. ------------------------------------------------------------------------ [2009-05-09 19:11:15] jani@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ ------------------------------------------------------------------------ [2009-05-09 14:10:52] rick at meritos dot nl Description: ------------ After a curl handle is copied and the original closed with curl_close(), the copy no longer seems to contain the CURLOPT_POSTFIELDS option. If the original is excecuted first, things get even stranger, the return value of curl_exec() on the copy seems to be borked. Reproduce code: --------------- $url = "http://www.example.com/get.php?test=getpost"; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe"); curl_setopt($ch, CURLOPT_URL, $url); $copy = curl_copy_handle($ch); curl_close($ch); $curl_content = curl_exec($copy); var_dump( $curl_content ); Expected result: ---------------- string(163) "array(1) { ["test"]=> string(7) "getpost" } array(3) { ["Hello"]=> string(5) "World" ["Foo"]=> string(3) "Bar" ["Person"]=> string(8) "John Doe" } Actual result: -------------- string(61) "array(1) { ["test"]=> string(7) "getpost" } array(0) { } " Note: comment out the curl_close($ch); , and it will return the expected result. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48208&edit=1

« previous php.bugs (#145730) next »