#38637 [NEW]: curl_exec return true with curl_copy_handle
| From: | waax at yahoo dot com | Date: | Tue, 29 Aug 2006 01:06:50 +0000 |
| Subject: | #38637 [NEW]: curl_exec return true with curl_copy_handle | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-101465@lists.php.net to get a copy of this message | ||
From: waax at yahoo dot com
Operating system: Windows XP SP2
PHP version: 5.1.5
PHP Bug Type: cURL related
Bug description: curl_exec return true with curl_copy_handle
Description:
------------
My script create a default curl handle with some default option along
CURLOPT_RETURNTRANSFER that is used as a "template". This default curl
handle is then copied with curl_copy_handle for all connections i need to
create.
I expected each call of curl_exec to return the content downloaded.
Instead, each call return bool(true).
libcurl/7.14.0 OpenSSL/0.9.8a zlib/1.2.3
Reproduce code:
---------------
<?php
// Creating default Curl Handler
$ch_default = curl_init();
// Setting some options
curl_setopt($ch_default, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch_default, CURLOPT_AUTOREFERER, true);
curl_setopt($ch_default, CURLOPT_RETURNTRANSFER, true);
$ch2 = curl_copy_handle($ch_default);
// Uncomment to see the difference
// $ch2 = curl_init();
// curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_URL, "http://yahoo.com");
$res = curl_exec($ch2);
var_dump($res);
?>
Expected result:
----------------
string(10074) "<html><head>
<title>Yahoo!</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="PICS-Label" content='(PICS-1.1
"http://www.icra.org/ratingsv02.html" l r
(cz 1 lz 1 nz 1 oz 1 vz 1) gen
true for "http://www.yahoo.com" r (cz1 lz 1 nz 1
oz 1 vz 1)
"http://www.rsac.org/ratingsv01.html" l r
(n 0 s 0 v 0 l0) gen true for
"http://www.yahoo.com" r (n 0 s 0 v 0 l
0))'>
[TRUNCATED]
Actual result:
--------------
bool(true)
--
Edit bug report at http://bugs.php.net/?id=38637&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38637&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38637&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38637&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38637&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38637&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38637&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38637&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38637&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38637&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38637&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38637&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38637&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38637&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38637&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38637&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38637&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38637&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38637&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38637&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38637&r=mysqlcfg