CIMD2 patch

Michael Zervakis <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Dear All

    We noticed that CIMD2 send messages loop will never exit as long as 
outgoing_queue has data. This means that if we have a constant queue of 
at least 1 MT, Kannel will not process the buffer of received MOs. In 
real world situations we noticed that Kannel halted the processing of MO 
buffer for hours. We made a quick fix to gw/smsc/smsc_cimd2.c to break 
the loop every 30 MTs to allow Kannel to process the received MTs.

Regards,
smsc_cimd2_patch.txt (text/plain, 1008 B)
Index: gw/smsc/smsc_cimd2.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_cimd2.c,v
retrieving revision 1.33
diff -u -r1.33 smsc_cimd2.c
--- gw/smsc/smsc_cimd2.c        10 Mar 2008 09:37:42 -0000      1.33
+++ gw/smsc/smsc_cimd2.c        3 Oct 2008 09:28:05 -0000
@@ -2165,6 +2165,7 @@
     SMSCConn  *conn = arg;
     PrivData *pdata = conn->data;
     double    sleep = 0.0001;
+    int _msg_counter = 0;

     /* Make sure we log into our own log-file if defined */
     log_thread_to(conn->log_idx);
@@ -2205,11 +2206,14 @@
         } while (msg);

         /* send messages */
+        _msg_counter = 0;
         do {
             msg = gwlist_extract_first(pdata->outgoing_queue);
             if (msg) {
                 sleep = 0;
                 if (cimd2_submit_msg(conn,msg) != 0) break;
+               _msg_counter++;
+               if (30 == _msg_counter) break;
             }
         } while (msg);
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.