Browse code

presence: delete expired in-memory presentity records

Daniel-Constantin Mierla authored on 21/04/2020 17:45:01
Showing 1 changed files
... ...
@@ -265,7 +265,6 @@ void ps_ptable_timer_clean(unsigned int ticks, void *param)
265 265
 	if(ptlist==NULL) {
266 266
 		return;
267 267
 	}
268
-
269 268
 	for(ptn = ptlist; ptn != NULL; ptn = ptn->next) {
270 269
 		memset(&pres, 0, sizeof(presentity_t));
271 270
 
... ...
@@ -316,6 +315,12 @@ void ps_ptable_timer_clean(unsigned int ticks, void *param)
316 315
 	}
317 316
 
318 317
 error:
318
+	for(ptn = ptlist; ptn != NULL; ptn = ptn->next) {
319
+		if(ps_ptable_remove(ptn) <0) {
320
+			LM_ERR("failed deleting presentity item\n");
321
+		}
322
+	}
323
+
319 324
 	if(ptlist != NULL) {
320 325
 		ps_presentity_list_free(ptlist, 1);
321 326
 	}