[BUG] Database DLR crashes Kannel after dlr schema change

"Oded Arbel" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi Stipe.
 
After your latest change to the DLR handling, using DLR with mysql crashes the system everytime. in dlr_add_{mysql|sdb}, in the octstr_format call you added the "source" field, but not the data to the format call. as a result, octstr_format is missing one parameter and is trying to format an integer as a cstring - which promply crashes the box.
 
I must say - for a simple bug, this was quite anoying to track down, especially as we had a presentation running at the same time with untested code running on the demo server (because of the SMPP esm_class bug I had to upload a CVS snapshot with a fix to the demo server, and that snapshot already had the DLR changes in).
 
As always, here's a patch ;-)
 
--
Oded Arbel
m-Wise mobile solutions
[email protected]
 
+972-9-9581711 (116)
+972-67-340014
 
::..
'I have been told that "Introduction to Objectivist Epistemology" was required reading at
the Xerox PARC lab where OOP was invented, but this may be merely an urban legend.' 
 -- Bryce Wilcox
dlr.patch (application/octet-stream, 1003 B)
--- ../kannel-dev/gateway/gw/dlr.c	2002-09-04 20:42:56.000000000 +0300
+++ gateway/gw/dlr.c	2002-09-05 21:45:42.000000000 +0300
@@ -421,7 +421,7 @@
                         octstr_get_cstr(field_src), octstr_get_cstr(field_dst),
                         octstr_get_cstr(field_serv), octstr_get_cstr(field_url), 
                         octstr_get_cstr(field_mask), octstr_get_cstr(field_status),
-                        smsc, ts, dst, service,	url, mask, 0);
+                        smsc, ts, src, dst, service,	url, mask, 0);
 
     mutex_lock(dlr_mutex);
   
@@ -448,7 +448,7 @@
                         octstr_get_cstr(field_src), octstr_get_cstr(field_dst), 
                         octstr_get_cstr(field_serv), octstr_get_cstr(field_url), 
                         octstr_get_cstr(field_mask), octstr_get_cstr(field_status),
-                        smsc, ts, dst, service,	url, mask, 0);
+                        smsc, ts, src, dst, service,	url, mask, 0);
 
     mutex_lock(dlr_mutex);
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.