mirror of https://github.com/BOINC/boinc.git
- GUI RPC: improved error reporting
svn path=/trunk/boinc/; revision=21585
This commit is contained in:
parent
2858ced9f4
commit
689f6c1625
|
@ -3780,3 +3780,11 @@ David 19 May 2010
|
||||||
|
|
||||||
client/
|
client/
|
||||||
boinc_cmd.cpp
|
boinc_cmd.cpp
|
||||||
|
|
||||||
|
David 19 May 2010
|
||||||
|
- GUI RPC: improved error reporting
|
||||||
|
|
||||||
|
lib/
|
||||||
|
gui_rpc_client_ops.cpp
|
||||||
|
html/ops/
|
||||||
|
credit.php
|
||||||
|
|
|
@ -8,9 +8,16 @@ require_once("../inc/boinc_db.inc");
|
||||||
|
|
||||||
define('COBB_SCALE', 200/86400e9);
|
define('COBB_SCALE', 200/86400e9);
|
||||||
|
|
||||||
|
function gavid($avid, $appid) {
|
||||||
|
if ($avid < 0) {
|
||||||
|
return $appid*1000000 - $avid;
|
||||||
|
}
|
||||||
|
return $avid;
|
||||||
|
}
|
||||||
|
|
||||||
function show_result($r) {
|
function show_result($r, $w) {
|
||||||
$hav = BoincHostAppVersion::lookup($r->hostid, $r->app_version_id);
|
$gavid = gavid($r->app_version_id, $w->appid);
|
||||||
|
$hav = BoincHostAppVersion::lookup($r->hostid, $gavid);
|
||||||
$av = BoincAppVersion::lookup_id($r->app_version_id);
|
$av = BoincAppVersion::lookup_id($r->app_version_id);
|
||||||
$raw_credit = $r->elapsed_time*$r->flops_estimate*COBB_SCALE;
|
$raw_credit = $r->elapsed_time*$r->flops_estimate*COBB_SCALE;
|
||||||
echo "<hr><pre>
|
echo "<hr><pre>
|
||||||
|
@ -62,7 +69,7 @@ function handle_result($resultid) {
|
||||||
$rs = BoincResult::enum("workunitid=$r->workunitid and validate_state=1");
|
$rs = BoincResult::enum("workunitid=$r->workunitid and validate_state=1");
|
||||||
$app_version_ids = array();
|
$app_version_ids = array();
|
||||||
foreach ($rs as $r) {
|
foreach ($rs as $r) {
|
||||||
show_result($r);
|
show_result($r, $w);
|
||||||
$app_version_ids[] = $r->app_version_id;
|
$app_version_ids[] = $r->app_version_id;
|
||||||
}
|
}
|
||||||
$app_version_ids = array_unique($app_version_ids);
|
$app_version_ids = array_unique($app_version_ids);
|
||||||
|
|
|
@ -1927,14 +1927,21 @@ int RPC_CLIENT::result_op(RESULT& result, const char* op) {
|
||||||
|
|
||||||
int RPC_CLIENT::get_host_info(HOST_INFO& h) {
|
int RPC_CLIENT::get_host_info(HOST_INFO& h) {
|
||||||
int retval;
|
int retval;
|
||||||
|
char buf[256];
|
||||||
SET_LOCALE sl;
|
SET_LOCALE sl;
|
||||||
RPC rpc(this);
|
RPC rpc(this);
|
||||||
|
|
||||||
retval = rpc.do_rpc("<get_host_info/>");
|
retval = rpc.do_rpc("<get_host_info/>");
|
||||||
if (!retval) {
|
if (retval) return retval;
|
||||||
retval = h.parse(rpc.fin);
|
while (rpc.fin.fgets(buf, 256)) {
|
||||||
|
if (match_tag(buf, "<host_info>")) {
|
||||||
|
return h.parse(rpc.fin);
|
||||||
|
}
|
||||||
|
if (match_tag(buf, "<unauthorized")) {
|
||||||
|
return ERR_AUTHENTICATOR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return ERR_XML_PARSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue