mirror of https://github.com/BOINC/boinc.git
Allow for HTTP redirects
* In case of a redirect the return code does NOT overwrite the original return code * It's stored in the result's `redirect_code` instead, so check that as well
This commit is contained in:
parent
51ec5b7015
commit
4c7e613333
|
@ -381,7 +381,7 @@ function boincstats_get_project_stats($type = 'total', $cpid = NULL) {
|
|||
$stats_xml = NULL;
|
||||
$target_url = "http://{$stats_server}/{$stats_rpc}{$query}";
|
||||
$result = drupal_http_request($target_url);
|
||||
if (in_array($result->code, array(200, 304))) {
|
||||
if (in_array($result->code, array(200, 304)) || in_array($result->redirect_code, array(200, 304))) {
|
||||
$stats_xml = simplexml_load_string($result->data);
|
||||
}
|
||||
watchdog('boincstats', $target_url);
|
||||
|
|
|
@ -2242,7 +2242,7 @@ function boincuser_get_stats_user_data($cpid = null) {
|
|||
// Load XML from RPC
|
||||
$target_url = "http://{$stats_server}/{$stats_rpc}{$query}";
|
||||
$result = drupal_http_request($target_url);
|
||||
if (in_array($result->code, array(200, 304))) {
|
||||
if (in_array($result->code, array(200, 304)) || in_array($result->redirect_code, array(200, 304))) {
|
||||
return simplexml_load_string($result->data);
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue