Ver Fonte

presence: compute presentity table slot index using correct structure

Daniel-Constantin Mierla há 5 anos atrás
pai
commit
55c6f7751c
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      src/modules/presence/hash.c

+ 3 - 3
src/modules/presence/hash.c

@@ -1024,7 +1024,7 @@ int ps_ptable_replace(ps_presentity_t *pt)
 		ptc.ruid = pres_sruid.uid;
 	}
 
-	idx = ptn->hashid % _ps_ptable->ssize;
+	idx = ptc.hashid % _ps_ptable->ssize;
 
 	lock_get(&_ps_ptable->slots[idx].lock);
 	ptn = _ps_ptable->slots[idx].plist;
@@ -1082,7 +1082,7 @@ int ps_ptable_update(ps_presentity_t *pt)
 		ptc.ruid = pres_sruid.uid;
 	}
 
-	idx = ptn->hashid % _ps_ptable->ssize;
+	idx = ptc.hashid % _ps_ptable->ssize;
 
 	lock_get(&_ps_ptable->slots[idx].lock);
 	ptn = _ps_ptable->slots[idx].plist;
@@ -1138,7 +1138,7 @@ int ps_ptable_remove(ps_presentity_t *pt)
 	memcpy(&ptc, pt, sizeof(ps_presentity_t));
 
 	ptc.hashid = core_case_hash(&pt->user, &pt->domain, 0);
-	idx = ptn->hashid % _ps_ptable->ssize;
+	idx = ptc.hashid % _ps_ptable->ssize;
 
 	lock_get(&_ps_ptable->slots[idx].lock);
 	ptn = _ps_ptable->slots[idx].plist;