php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29535 CURLOPT_RETURNTRANSFER not maintained when URL is switched
Submitted: 2004-08-05 14:58 UTC Modified: 2005-02-15 01:00 UTC
From: mark_connolly at acm dot org Assigned:
Status: No Feedback Package: cURL related
PHP Version: 4.3.7 OS: Linux RedHat 9.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mark_connolly at acm dot org
New email:
PHP Version: OS:

 

 [2004-08-05 14:58 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-05 15:02 UTC] 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 15:09 UTC] mark_connolly at acm dot org
libcurl/7.12.0 OpenSSL/0.9.7d zlib/1.1.4
 [2005-02-15 01:00 UTC] 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC