[PATCH] Resubmit: dlr.c logic to remove old DLRs

"Oded Arbel" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi list.

Since I didn't get any concrete responses about my queries about dlr.c
mis-behavior about removing non-final DLRs when getting SMSC_* type DLR,
here's my patch to dlr.c to add support for generating SMSC_* type DLRs.
it changes the logic for removing old DLRs from storage to only remove
the DLR if it reaches on of the "final" stages (success or failure),
instead of the current implementation where it will remove DLRs from
storage on any even other the DLR_BUFFERED.

--
Oded Arbel
m-Wise Inc.
[email protected]

ACCIDENT, n.
      An inevitable occurrence due to the action of immutable natural
laws.
	-- the Devil's Dictionary / Ambrose Bierce
dlr.patch (application/octet-stream, 1.2 KB)
Index: gw/dlr.c
===================================================================
RCS file: /home/cvs/gateway/gw/dlr.c,v
retrieving revision 1.8
diff -u -r1.8 dlr.c
--- gw/dlr.c	8 Mar 2002 17:27:40 -0000	1.8
+++ gw/dlr.c	17 Mar 2002 18:51:24 -0000
@@ -338,9 +338,12 @@
     {
     	debug("dlr.dlr",0,"ignoring DLR message because of mask");
     }
- 
-    if((typ & DLR_BUFFERED) &&
-    	((dlr_mask & DLR_SUCCESS) || (dlr_mask & DLR_FAIL)))
+
+    if (
+	( (typ & DLR_SMSC_SUCCESS) && (dlr_mask & (DLR_SUCCESS | DLR_BUFFERED | DLR_FAIL)) )
+	||
+	( (typ & DLR_BUFFERED) && (dlr_mask & (DLR_SUCCESS | DLR_FAIL)) )
+	)
     {
     	debug("dlr.mysql",0,"dlr not deleted because we wait on more reports");
     }
@@ -414,8 +417,11 @@
 	   	octstr_destroy(text);
 		msg=NULL;
 	   }
-	    if ((typ & DLR_BUFFERED) && 
-	       ((dlr_mask & DLR_SUCCESS) || (dlr_mask & DLR_FAIL))) {
+	    if (
+		( (typ & DLR_SMSC_SUCCESS) && (dlr_mask & (DLR_SUCCESS | DLR_BUFFERED | DLR_FAIL)) )
+		||
+		( (typ & DLR_BUFFERED) && (dlr_mask & (DLR_SUCCESS | DLR_FAIL)) )
+		)
 	        info(0,"dlr not destroyed, still waiting for other delivery report"); 
 	    } else {
 		list_delete(dlr_waiting_list,i,1);
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.