projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uset user moved before load ancestor data
[brisk.git]
/
web
/
Obj
/
hardban.phh
diff --git
a/web/Obj/hardban.phh
b/web/Obj/hardban.phh
index
7423b6a
..
477a410
100644
(file)
--- a/
web/Obj/hardban.phh
+++ b/
web/Obj/hardban.phh
@@
-184,6
+184,8
@@
class Hardbans {
log_only("PUT_VAR FALLITA ".strlen(serialize($hban)));
log_only(serialize($hban));
}
log_only("PUT_VAR FALLITA ".strlen(serialize($hban)));
log_only(serialize($hban));
}
+ log_shme("Hardban::save_data2");
+
}
$hban->shm_sz = $shm_sz;
}
$hban->shm_sz = $shm_sz;
@@
-215,8
+217,9
@@
class Hardbans {
log_only("hardban count ".count($hban->item)." _n: ".$hban->item_n);
$hban->mod = FALSE;
log_only("hardban count ".count($hban->item)." _n: ".$hban->item_n);
$hban->mod = FALSE;
- if (shm_put_var($shm, $tok, $hban) != FALSE) {
+ if (
@
shm_put_var($shm, $tok, $hban) != FALSE) {
shm_detach($shm);
shm_detach($shm);
+ log_shme("Hardban::save_data");
return (TRUE);
}
$hban->mod = $oldmod;
return (TRUE);
}
$hban->mod = $oldmod;
@@
-235,13
+238,13
@@
class Hardbans {
return (FALSE);
}
return (FALSE);
}
-
function lock_data(
)
+
static function lock_data($is_exclusive
)
{
if (($tok = @ftok(FTOK_PATH."/hardbans", "B")) == -1) {
return (FALSE);
}
// echo "FTOK ".$tok."<br>";
{
if (($tok = @ftok(FTOK_PATH."/hardbans", "B")) == -1) {
return (FALSE);
}
// echo "FTOK ".$tok."<br>";
- if (($res = sem_get($tok)) == FALSE) {
+ if (($res = sem_get($tok
, ($is_exclusive ? 1 : LOCK_SHARE_MAX)
)) == FALSE) {
return (FALSE);
}
if (sem_acquire($res)) {
return (FALSE);
}
if (sem_acquire($res)) {
@@
-253,7
+256,7
@@
class Hardbans {
return (FALSE);
}
return (FALSE);
}
- function unlock_data($res)
+
static
function unlock_data($res)
{
GLOBAL $sess;
{
GLOBAL $sess;
@@
-267,7
+270,7
@@
class Hardbans {
{
$bantime = -1;
/* if it exists check for a valid challenge */
{
$bantime = -1;
/* if it exists check for a valid challenge */
- if (($a_sem = Hardbans::lock_data()) != FALSE) {
+ if (($a_sem = Hardbans::lock_data(
TRUE
)) != FALSE) {
if (($hban = &Hardbans::load_data()) != FALSE) {
for ($e = 0 ; $e < $hban->item_n ; $e++) {
if (($hban = &Hardbans::load_data()) != FALSE) {
for ($e = 0 ; $e < $hban->item_n ; $e++) {
@@
-301,7
+304,7
@@
class Hardbans {
{
$found = FALSE;
/* if it exists check for a valid challenge */
{
$found = FALSE;
/* if it exists check for a valid challenge */
- if (($a_sem = Hardbans::lock_data()) != FALSE) {
+ if (($a_sem = Hardbans::lock_data(
TRUE
)) != FALSE) {
if (($hban = &Hardbans::load_data()) != FALSE) {
if (($hban = &Hardbans::load_data()) != FALSE) {