From: sergey_s_m at mail dot ru
Operating system: Suse9.0
PHP version: 5.0.1
PHP Bug Type: cURL related
Bug description: proxy problem in Curl library
Description:
------------
Infinite looping when I tried to get page through proxy
using curl library and option "CURLOPT_FOLLOWLOCATION".
Without this option all works OK. This bug I saw under
curl-7.10.5, curl-7.11.2 curl-7.12.2
Reproduce code:
---------------
$proxy="64.56.118.178:1080";
$addr = "http://www.yandex.ru/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $addr);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPGET,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$parse = curl_exec($ch);
print("OK");
Expected result:
----------------
I've expected printing "OK"
Actual result:
--------------
firstly I sow nothing.
when I became use curl_setopt($ch, CURLOPT_VERBOSE, TRUE)
I sow lopping next:
64.56.118.178:1080
* About to connect() to 64.56.118.178 port 1080
* Trying 64.56.118.178... * connected
* Connected to 64.56.118.178 (64.56.118.178) port 1080
> GET http://www.yandex.ru/ HTTP/1.1
Host: www.yandex.ru
Pragma: no-cache
Accept: */*
< HTTP/1.0 302 Found
< Connection: Close
< Location: http://no-full-proxy-allowed/
* Closing connection #0
* Issue another request to this URL: 'http://
no-full-proxy-allowed/'
* About to connect() to 64.56.118.178 port 1080
* Trying 64.56.118.178... * connected
* Connected to 64.56.118.178 (64.56.118.178) port 1080
> GET http://no-full-proxy-allowed/ HTTP/1.1
Host: no-full-proxy-allowed
Pragma: no-cache
Accept: */*
Notice: when I use $addr = "http://www.yandex.ru"; instead
$addr = "http://www.yandex.ru/"; All works OK!
--
Edit bug report at http://bugs.php.net/?id=30613&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30613&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30613&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30613&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30613&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30613&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30613&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30613&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30613&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30613&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30613&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30613&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30613&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30613&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30613&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30613&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30613&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30613&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30613&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30613&r=mysqlcfg