summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <dag@janrain.com>2008-05-29 21:12:44 +0000
committertailor <dag@janrain.com>2008-05-29 21:12:44 +0000
commite5c67678f4818c790d53d1b00fb0205f2b28badb (patch)
treecfae65b8eb5c420d829734a515d41d837f68182b /Auth
parentebbed8d1d4f9755109eb86d82c72142ae59236f0 (diff)
downloadphp-openid-e5c67678f4818c790d53d1b00fb0205f2b28badb.zip
php-openid-e5c67678f4818c790d53d1b00fb0205f2b28badb.tar.gz
php-openid-e5c67678f4818c790d53d1b00fb0205f2b28badb.tar.bz2
[project @ Fetcher: add Range header: 0-1MB]
Diffstat (limited to 'Auth')
-rw-r--r--Auth/Yadis/HTTPFetcher.php2
-rw-r--r--Auth/Yadis/ParanoidHTTPFetcher.php2
-rw-r--r--Auth/Yadis/PlainHTTPFetcher.php4
3 files changed, 6 insertions, 2 deletions
diff --git a/Auth/Yadis/HTTPFetcher.php b/Auth/Yadis/HTTPFetcher.php
index 68de7f4..c0eedd0 100644
--- a/Auth/Yadis/HTTPFetcher.php
+++ b/Auth/Yadis/HTTPFetcher.php
@@ -18,6 +18,8 @@
*/
require_once "Auth/OpenID.php";
+define('Auth_OpenID_FETCHER_MAX_RESPONSE_KB', 1024);
+
class Auth_Yadis_HTTPResponse {
function Auth_Yadis_HTTPResponse($final_url = null, $status = null,
$headers = null, $body = null)
diff --git a/Auth/Yadis/ParanoidHTTPFetcher.php b/Auth/Yadis/ParanoidHTTPFetcher.php
index 9632bb6..84b7c85 100644
--- a/Auth/Yadis/ParanoidHTTPFetcher.php
+++ b/Auth/Yadis/ParanoidHTTPFetcher.php
@@ -115,6 +115,8 @@ class Auth_Yadis_ParanoidHTTPFetcher extends Auth_Yadis_HTTPFetcher {
curl_setopt($c, CURLOPT_TIMEOUT, $off);
curl_setopt($c, CURLOPT_URL, $url);
+ curl_setopt($c, CURLOPT_RANGE,
+ "0-${1024*Auth_OpenID_FETCHER_MAX_RESPONSE_KB}");
curl_exec($c);
diff --git a/Auth/Yadis/PlainHTTPFetcher.php b/Auth/Yadis/PlainHTTPFetcher.php
index c80e169..f61ab64 100644
--- a/Auth/Yadis/PlainHTTPFetcher.php
+++ b/Auth/Yadis/PlainHTTPFetcher.php
@@ -19,8 +19,6 @@
*/
require_once "Auth/Yadis/HTTPFetcher.php";
-define('Auth_OpenID_FETCHER_MAX_RESPONSE_KB', 1024);
-
/**
* This class implements a plain, hand-built socket-based fetcher
* which will be used in the event that CURL is unavailable.
@@ -81,6 +79,8 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
"User-Agent: $user_agent",
"Host: ".$parts['host'].
($specify_port ? ":".$parts['port'] : ""),
+ "Range: 0-".
+ (1024*Auth_OpenID_FETCHER_MAX_RESPONSE_KB),
"Port: ".$parts['port']);
$errno = 0;