#29535 [NEW]: CURLOPT_RETURNTRANSFER not maintained when URL is switched
| From: | mark_connolly at acm dot org | Date: | Thu, 05 Aug 2004 12:58:28 +0000 |
| Subject: | #29535 [NEW]: CURLOPT_RETURNTRANSFER not maintained when URL is switched | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-64131@lists.php.net to get a copy of this message | ||
From: mark_connolly at acm dot org
Operating system: Linux RedHat 9.0
PHP version: 4.3.7
PHP Bug Type: cURL related
Bug description: CURLOPT_RETURNTRANSFER not maintained when URL is switched
Description:
------------
CURLOPT_RETURNTRANSFER is set to 1 for all processes.
String response is properly returned.
Target http site changed to new target https site.
String response is properly returned.
Target is changed back to http site.
Boolean true (1) is returned for each invocation to the http site.
Target is changed back to https site.
String response is properly returned.
Reproduce code:
---------------
if (GATEWAY_MODE_PROD) {
$gatewayProvider = "https://...";
} else {
$gatewayProvider = "http://...";
}
$urlPostFields = "postStringCreatedEarlier";
$curlReq = curl_init($gatewayProvider);
curl_setopt($curlReq, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlReq, CURLOPT_REFERER, GATEWAY_REFERER);
curl_setopt($curlReq, CURLOPT_POST, 1);
curl_setopt($curlReq, CURLOPT_HEADER, 0);
curl_setopt($curlReq, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curlReq, CURLOPT_FAILONERROR, 1);
curl_setopt($curlReq, CURLOPT_TIMEOUT, CONNECTION_TIMEOUT);
curl_setopt($curlReq, CURLOPT_POSTFIELDS, $urlPostFields);
$curlResp = curl_exec($curlReq);
Expected result:
----------------
The expected result is to always see the string response.
Actual result:
--------------
When starting at !GATEWAY_MODE_PROD and switching to GATEWAY_MODE_PROD,
expected response is returned.
Switching again back to !GATEWAY_MODE_PROD causes the boolean response to
be returned rather than the string response.
Switching again back to GATEWAY_MODE_PROD returns the expected string
result.
--
Edit bug report at http://bugs.php.net/?id=29535&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29535&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29535&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29535&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29535&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29535&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29535&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29535&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29535&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29535&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29535&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29535&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29535&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29535&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29535&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29535&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29535&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29535&r=float