Explorar el Código

presence: delete expired in-memory presentity records

Daniel-Constantin Mierla hace 5 años
padre
commit
174cc5e8d1
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      src/modules/presence/publish.c

+ 6 - 1
src/modules/presence/publish.c

@@ -265,7 +265,6 @@ void ps_ptable_timer_clean(unsigned int ticks, void *param)
 	if(ptlist==NULL) {
 		return;
 	}
-
 	for(ptn = ptlist; ptn != NULL; ptn = ptn->next) {
 		memset(&pres, 0, sizeof(presentity_t));
 
@@ -316,6 +315,12 @@ void ps_ptable_timer_clean(unsigned int ticks, void *param)
 	}
 
 error:
+	for(ptn = ptlist; ptn != NULL; ptn = ptn->next) {
+		if(ps_ptable_remove(ptn) <0) {
+			LM_ERR("failed deleting presentity item\n");
+		}
+	}
+
 	if(ptlist != NULL) {
 		ps_presentity_list_free(ptlist, 1);
 	}