With ParanoidHTTPFetcher.php, it receives 206 Partial Content because the curl library uses Range request header. I'm not quite sure if PHP runtime is bad or apache httpd server does on my CentOS 5.1.
I fixed following code to Yadis.php and works file so far.
--- Yadis.php 2008-06-30 17:42:16.000000000 +0900
+++ Yadis.php.modify 2008-06-30 17:35:41.000000000 +0900
@@ -317,6 +317,11 @@
* Auth_Yadis_Yadis, depending on whether the discovery
* succeeded.
*/
+ function is_valid_response_code($code)
+ {
+ return in_array($code,array(200,201,202,203,204,205,206));
+ }
+
function discover($uri, &$fetcher,
$extra_ns_map = null, $timeout = 20)
{
@@ -332,7 +337,8 @@
$response = $fetcher->get($uri, $headers);
- if (!$response || ($response->status != 200)) {
+ if (!$response &&
+ $result->is_valid_response_code($response->status )){
$result->fail();
return $result;
}
@@ -361,7 +367,8 @@
$response = $fetcher->get($yadis_location);
- if ((!$response) || ($response->status != 200)) {
+ if (!$response &&
+ $result->is_valid_response_code($response->status )){
$result->fail();
return $result;
}
@@ -378,4 +385,3 @@
}
?>
-