#29535 [Opn->Fbk]: CURLOPT_RETURNTRANSFER not maintained when URL is switched
| From: | sniper@php.net | Date: | Thu, 03 Feb 2005 03:53:51 +0000 |
| Subject: | #29535 [Opn->Fbk]: CURLOPT_RETURNTRANSFER not maintained when URL is switched | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-73332@lists.php.net to get a copy of this message | ||
ID: 29535
Updated by: sniper@php.net
Reported By: mark_connolly at acm dot org
-Status: Open
+Status: Feedback
Bug Type: cURL related
Operating System: Linux RedHat 9.0
PHP Version: 4.3.7
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-08-05 15:09:14] mark_connolly at acm dot org
libcurl/7.12.0 OpenSSL/0.9.7d zlib/1.1.4
------------------------------------------------------------------------
[2004-08-05 15:02:15] mark_connolly at acm dot org
ethereal shows that in the fail case, expected results are being
returned in the response from the target server.
------------------------------------------------------------------------
[2004-08-05 14:58:27] mark_connolly at acm dot org
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 this bug report at http://bugs.php.net/?id=29535&edit=1