projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timing log on Challenges semaphore
[brisk.git]
/
web
/
Obj
/
hardban.phh
diff --git
a/web/Obj/hardban.phh
b/web/Obj/hardban.phh
index
99b7033
..
05ca8e1
100644
(file)
--- a/
web/Obj/hardban.phh
+++ b/
web/Obj/hardban.phh
@@
-44,6
+44,8
@@
class Hardban {
}
class Hardbans {
}
class Hardbans {
+ static $delta_t;
+
var $item;
var $item_n;
var $mod;
var $item;
var $item_n;
var $mod;
@@
-66,8
+68,8
@@
class Hardbans {
log_auth("xxx", sprintf("Hardbans::add [%s]\n", $login));
log_auth("xxx", sprintf("Hardbans::add [%s]\n", $login));
- if (($chal = new Hardban($login, $ip, $session, $timeout)) ==
null
) {
- return (
$G_false
);
+ if (($chal = new Hardban($login, $ip, $session, $timeout)) ==
FALSE
) {
+ return (
FALSE
);
}
$this->item[$this->item_n] = $chal;
}
$this->item[$this->item_n] = $chal;
@@
-143,7
+145,7
@@
class Hardbans {
}
// Static functions
}
// Static functions
- static function
&
create()
+ static function create()
{
$chal =& new Hardbans();
{
$chal =& new Hardbans();
@@
-152,9
+154,9
@@
class Hardbans {
return $chal;
}
return $chal;
}
- function
&
load_data()
+ function load_data()
{
{
- GLOBAL $
G_false, $
sess;
+ GLOBAL $sess;
$doexit = FALSE;
do {
if (($tok = @ftok(FTOK_PATH."/hardbans", "B")) == -1) {
$doexit = FALSE;
do {
if (($tok = @ftok(FTOK_PATH."/hardbans", "B")) == -1) {
@@
-191,18
+193,17
@@
class Hardbans {
$hban->garbage_manager(TRUE);
$hban->garbage_manager(TRUE);
- $ret = &$hban;
- return ($ret);
+ return ($hban);
} while (0);
if ($doexit)
exit();
} while (0);
if ($doexit)
exit();
- return (
$G_false
);
+ return (
FALSE
);
}
}
- function save_data(
&
$hban)
+ function save_data($hban)
{
$shm = FALSE;
$oldmod = $hban->mod;
{
$shm = FALSE;
$oldmod = $hban->mod;
@@
-248,7
+249,8
@@
class Hardbans {
return (FALSE);
}
if (sem_acquire($res)) {
return (FALSE);
}
if (sem_acquire($res)) {
- log_lock("LOCK hardbans");
+ self::$delta_t = microtime(TRUE);
+ log_lock("LOCK hardbans [".self::$delta_t."]");
return ($res);
}
else
return ($res);
}
else
@@
-259,7
+261,7
@@
class Hardbans {
{
GLOBAL $sess;
{
GLOBAL $sess;
- log_lock("UNLOCK hardbans");
+ log_lock("UNLOCK hardbans
[".(microtime(TRUE) - (self::$delta_t))."]
");
return (sem_release($res));
}
return (sem_release($res));
}