dlr_mysql.c patch

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <000f01ca4a84$aaed5720$02b2a8c0@tardis>
Hi,

A simple patch to help with missing dlrs when using mysql.

BR,
Nikos
dlr_mysql.diff (application/octet-stream, 1.1 KB)
Index: gw/dlr_mysql.c
===================================================================
RCS file: /home/cvs/gateway/gw/dlr_mysql.c,v
retrieving revision 1.16
diff -a -u -r1.16 dlr_mysql.c
--- gw/dlr_mysql.c	4 Sep 2009 07:59:31 -0000	1.16
+++ gw/dlr_mysql.c	11 Oct 2009 01:29:02 -0000
@@ -226,6 +226,7 @@
     Octstr *sql, *os_status;
     DBPoolConn *pconn;
     List *binds = gwlist_create();
+    int  res;
 
     debug("dlr.mysql", 0, "updating DLR status in database");
 
@@ -246,8 +247,9 @@
 #if defined(DLR_TRACE)
     debug("dlr.mysql", 0, "sql: %s", octstr_get_cstr(sql));
 #endif
-    if (dbpool_conn_update(pconn, sql, binds) == -1)
-        error(0, "DLR: MYSQL: Error while updating dlr entry for DST<%s>", octstr_get_cstr(dst));
+    if ((res = dbpool_conn_update(pconn, sql, binds)) == -1)
+       error(0, "DLR: MYSQL: Error while updating dlr entry for DST<%s> (status %d)", octstr_get_cstr(dst), status);
+    else if (!res) error(0, "DLR: MYSQL: No rows found to update for dlr entry for DST<%s>, (status %d)", octstr_get_cstr(dst), status);
 
     dbpool_conn_produce(pconn);
     gwlist_destroy(binds, 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.