Browse code

- 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 authored on 03/12/2004 17:05:29
Showing 1 changed files
... ...
@@ -133,17 +133,25 @@ void unlink_lump_rpl(struct sip_msg * msg, struct lump_rpl* lump)
133 133
 	}
134 134
 }
135 135
 
136
-
137
-
138
-void del_nonshm_lump_rpl( struct lump_rpl **head_list)
136
+void del_nonshm_lump_rpl(struct lump_rpl** list)
139 137
 {
140
-	struct lump_rpl *foo;
141
-
142
-	while( (*head_list) && (((*head_list)->flags&LUMP_RPL_SHMEM)==0) ) {
143
-		foo = (*head_list);
144
-		(*head_list) = foo->next;
145
-		free_lump_rpl( foo );
146
-	}
138
+        struct lump_rpl* it, *tmp;
139
+        struct lump_rpl** pred;
140
+
141
+        it = *list;
142
+        pred = list;
143
+
144
+        while(it) {
145
+                if (!(it->flags & LUMP_RPL_SHMEM)) {
146
+                        tmp = it;
147
+                        *pred = it->next;
148
+                        it = it->next;
149
+                        free_lump_rpl(tmp);
150
+                        continue;
151
+                }
152
+
153
+                pred = &it->next;
154
+                it = it->next;
155
+        }
147 156
 }
148 157
 
149
-