Browse Source

Merge branch 'master' of bitbucket.org:ckolivas/ckpool

master
ckolivas 10 years ago
parent
commit
88fff8eb22
  1. 2
      configure.ac
  2. 49
      pool/page.php
  3. 6
      pool/prime.php
  4. 13
      src/ckpool.c

2
configure.ac

@ -1,4 +1,4 @@
AC_INIT(ckpool, 0.8.3, kernel@kolivas.org)
AC_INIT(ckpool, 0.8.4, kernel@kolivas.org)
AC_CANONICAL_SYSTEM
AC_CONFIG_MACRO_DIR([m4])

49
pool/page.php

@ -84,6 +84,8 @@ function pghead($script_marker, $name)
{
global $page_title;
$iCrap = strpos($_SERVER['HTTP_USER_AGENT'],'iP');
$head = "<!DOCTYPE html>\n";
$head .= "<html><head><title>$page_title$name</title>";
@ -118,10 +120,15 @@ input.tiny {width: 0px; height: 0px; margin: 0px; padding: 0px; outline: none; b
#n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;}
#n42 td.navboxr {float: right;}
#n42 td.nav {position: relative;}
#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;}";
if (!$iCrap)
{
$head .= "
#n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;}
#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;}
#n42 td.nav:hover {background:#09e;}
#n42 td.nav:hover div.sub {background:#07e; visibility: visible;}
#n42 td.nav:hover div.sub {background:#07e; visibility: visible;}";
}
$head .= "
h1 {margin-top: 20px; float:middle; font-size: 20px;}
.foot, .push {height: 50px; font-size: 10pt;}
.title {background-color: #909090;}
@ -294,35 +301,35 @@ function pgtop($info, $dotop, $user, $douser)
$lsn = $info['now'] - $info['lastsh'];
$lhn = $info['now'] - $info['lasthb'];
$lwn = $info['now'] - $info['lastwi'];
if ($lsn < 2)
$lsc = 'green';
if ($lsn < 8)
$lsc = 'green.png';
else
{
if ($lsn < 4)
$lsc = 'orange';
if ($lsn < 10)
$lsc = 'orange.png';
else
$lsc = 'red';
$lsc = 'red.png';
}
if ($lhn < 3)
$lhc = 'green';
if ($lhn < 5)
$lhc = 'green.png';
else
{
if ($lhn < 6)
$lhc = 'orange';
if ($lhn < 10)
$lhc = 'orange.png';
else
$lhc = 'red';
$lhc = 'red.png';
}
if ($lwn < 36)
$lwc = 'green';
$lwc = 'green.png';
else
{
if ($lwn < 46)
$lwc = 'orange';
$lwc = 'orange.png';
else
$lwc = 'red';
$lwc = 'red.png';
}
$img1 = '<img border=0 src=/';
$img2 = '.png>';
$img2 = '>';
$ls = $img1.$lsc.$img2;
$lh = $img1.$lhc.$img2;
$lw = $img1.$lwc.$img2;
@ -405,6 +412,8 @@ function pgtop($info, $dotop, $user, $douser)
#
function pgmenu($menus)
{
$iCrap = strpos($_SERVER['HTTP_USER_AGENT'],'iP');
$ret = "\n<table cellpadding=0 cellspacing=0 border=0 width=100% id=n42>";
$ret .= '<tr><td width=100%>';
$ret .= '<table cellpadding=0 cellspacing=0 border=0 width=100%>';
@ -420,6 +429,13 @@ function pgmenu($menus)
$side = 'r';
continue;
}
if ($iCrap)
{
foreach ($submenus as $submenu => $item)
$ret .= "<td class=nav>".makeLink($item)."$submenu</a></td>";
}
else
{
$ret .= "<td class=navbox$side><table cellpadding=0 cellspacing=0 border=0>";
$first = true;
foreach ($submenus as $submenu => $item)
@ -442,6 +458,7 @@ function pgmenu($menus)
$ret .= '</table></div></td></tr></table>';
$ret .= '</td>';
}
}
$ret .= "</tr></table></td></tr></table>\n";
return $ret;
}

6
pool/prime.php

@ -53,7 +53,7 @@ function def_menu()
),
'gap' => array( # options not shown
'API' => 'api'),
'Help' => array('Help' => 'help',
'Help' => array(
'Payouts' => 'payout'));
return $dmenu;
}
@ -84,9 +84,7 @@ function check()
'PBlocks' => 'pblocks'
),
'Help' => array(
'Payouts' => 'payout',
'Workers ' => 'workers',
'Blocks' => 'blocks'
'Payouts' => 'payout'
)
);
tryLogInOut();

13
src/ckpool.c

@ -1204,14 +1204,18 @@ static proc_instance_t *child_by_pid(ckpool_t *ckp, pid_t pid)
static void *watchdog(void *arg)
{
#if 0
time_t last_relaunch_t = time(NULL);
#endif
ckpool_t *ckp = (ckpool_t *)arg;
rename_proc("watchdog");
sleep(1);
while (42) {
proc_instance_t *pi;
#if 0
time_t relaunch_t;
#endif
int pid, status;
pid = waitpid(0, &status, 0);
@ -1220,6 +1224,9 @@ static void *watchdog(void *arg)
LOGWARNING("Child process %s exited, terminating!", pi->processname);
break;
}
#if 0
/* Don't bother trying to respawn for now since communication
* breakdown between the processes will make them exit. */
relaunch_t = time(NULL);
if (relaunch_t == last_relaunch_t) {
LOGEMERG("Respawning processes too fast, exiting!");
@ -1233,6 +1240,12 @@ static void *watchdog(void *arg)
LOGEMERG("Unknown child process %d dead, exiting!", pid);
break;
}
#else
if (pi)
LOGEMERG("%s process dead, terminating!", pi->processname);
else
LOGEMERG("Unknown child process %d dead, exiting!", pid);
#endif
}
send_proc(&ckp->main, "shutdown");
return NULL;

Loading…
Cancel
Save