浏览代码

- del_nonshm_lump_rpl fixed to delete lumps that are not in shared memory
(this commit is worth two full days of debugging, credits go to Atle
Samuelsen who was helping me with debugging).

Jan Janak 21 年之前
父节点
当前提交
48b79d65fd
共有 1 个文件被更改,包括 19 次插入11 次删除
  1. 19 11
      data_lump_rpl.c

+ 19 - 11
data_lump_rpl.c

@@ -133,17 +133,25 @@ void unlink_lump_rpl(struct sip_msg * msg, struct lump_rpl* lump)
 	}
 	}
 }
 }
 
 
-
-
-void del_nonshm_lump_rpl( struct lump_rpl **head_list)
+void del_nonshm_lump_rpl(struct lump_rpl** list)
 {
 {
-	struct lump_rpl *foo;
-
-	while( (*head_list) && (((*head_list)->flags&LUMP_RPL_SHMEM)==0) ) {
-		foo = (*head_list);
-		(*head_list) = foo->next;
-		free_lump_rpl( foo );
-	}
+        struct lump_rpl* it, *tmp;
+        struct lump_rpl** pred;
+
+        it = *list;
+        pred = list;
+
+        while(it) {
+                if (!(it->flags & LUMP_RPL_SHMEM)) {
+                        tmp = it;
+                        *pred = it->next;
+                        it = it->next;
+                        free_lump_rpl(tmp);
+                        continue;
+                }
+
+                pred = &it->next;
+                it = it->next;
+        }
 }
 }
 
 
-