[PATCH] internal dlr race fix

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
Hi,

here is 3 liner patch to fix race condition in internal dlr.

-- 
Mit besten Grüßen aus Köln

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Ehrenstraße 2
50672 Köln

Fon: +49 (0221) 277 49 150
Fax: +49 (0221) 277 49 109

email: [email protected]
web: www.centrium.de
dlr-race.patch (text/x-diff, 850 B)
Index: gw/dlr.c
===================================================================
RCS file: /home/cvs/gateway/gw/dlr.c,v
retrieving revision 1.31
diff -a -u -r1.31 dlr.c
--- gw/dlr.c	14 Nov 2002 02:29:25 -0000	1.31
+++ gw/dlr.c	2 Dec 2002 16:34:09 -0000
@@ -511,6 +511,7 @@
     int dlr_mask;
     
     debug("dlr.dlr", 0, "Looking for DLR smsc=%s, ts=%s, dst=%s, type=%d", smsc, ts, dst, typ);
+    list_lock(dlr_waiting_list);
     len = list_len(dlr_waiting_list);
     for (i=0; i < len; i++) {
         dlr = list_get(dlr_waiting_list, i);
@@ -563,9 +564,11 @@
                 dlr_destroy(dlr);
             }
 
+            list_unlock(dlr_waiting_list);
             return msg;
         }
     }
+    list_unlock(dlr_waiting_list);
     debug("dlr.dlr", 0, "DLR not found!");
     /* we couldnt find a matching entry */
     return NULL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.