server_state <> 5) return "---";
switch($result->outcome) {
case 1: return $string_to_show; //Success
case 2: return "---"; //Couldn't send
case 3: return $string_to_show; //Client error
case 4: return "---"; //No reply
case 5: return "---"; //Didn't need
case 6: return "---"; // Validate error
default: return $string_to_show;
}
}
function result_granted_credit_string($result, $string_to_show) {
if ($result->server_state <> 5) return "---";
switch($result->outcome) {
case 1: //Success
switch ($result->validate_state) {
case 0:
case 4:
return "pending";
}
return $string_to_show;
case 2: return "---"; //Couldn't send
case 3: return "---"; //Client error
case 4: return "---"; //No reply
case 5: return "---"; //Didn't need
case 6: return "---"; //Validate error
default: return $string_to_show;
}
}
function result_server_state_string($s) {
switch($s) {
case 1: return "Inactive";
case 2: return "Unsent";
case 3: return "Unsent";
case 4: return "In Progress";
case 5: return "Over";
}
return "Unknown";
}
function result_outcome_string($s) {
switch($s) {
case 1: return "Success";
case 2: return "Couldn't send";
case 3: return "Client error";
case 4: return "No reply";
case 5: return "Didn't need";
case 6: return "Validate error";
}
return "Unknown";
}
function result_client_state_string($s) {
switch($s) {
case 0: return "New";
case 1: return "Downloading";
case 2: return "Downloaded";
case 3: return "Computing";
case 4: return "Uploading";
case 5: return "Done";
}
}
function validate_state_str($s) {
switch($s) {
case 0: return "Initial";
case 1: return "Valid";
case 2: return "Invalid";
case 3: return "WU error - check skipped";
case 4: return "Checked, but no consensus yet";
}
return "Unknown";
}
function wu_error_mask_str($s) {
$x = "";
if ($s & 1) {
$x = $x."Couldn't send result ";
$s -= 1;
}
if ($s & 2) {
$x = $x."Too many error results ";
$s -= 2;
}
if ($s & 4) {
$x = $x."Too many success results ";
$s -= 4;
}
if ($s & 8) {
$x = $x."Too many total results ";
$s -= 8;
}
if ($s & 16) {
$x = $x."Cancelled ";
$s -= 16;
}
if ($s) {
$x = $x."Unrecognized Error: $s ";
}
if (strlen($x)) {
} else {
$x="
";
}
return $x;
}
function result_table_start($show_wu_link, $show_host_link, $show_result_link) {
start_table();
echo "
".htmlspecialchars($result->stderr_out).""); row2("Validate state", validate_state_str($result->validate_state)); row2("Claimed credit", $result->claimed_credit); row2("Granted credit", $result->granted_credit); row2("application version", version_string($result->app_version_num)); end_table(); } ?>