CIMD2 modification proposal

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


At line 2196 of gw/smsc/smsc_cimd2.c the loops that send or receive 
messages is possible to block each other for quite long under certain 
circumstances. The most common situation is when a CIMD2 connection 
starts sending a long queue of MT messages (bulk scenario) the 
sms_receive function is blocked until the pdata->outgoing_queue is 
empty. This means that it is possible to pack SMS in pdata->received 
from minutes to hours thus destroying interactivity of SMS applications. 
A simple solution IMHO might be to break the send or receive loop when 
something enters pdata->outgoing_queue or pdata->received. I created a 
simple patch to implement this so please comment.

Sincerely,
Michael Zervakis
smsc_cimd2.c.patch (text/plain, 836 B)
? smsc_cimd2.c.patch
Index: gw/smsc/smsc_cimd2.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_cimd2.c,v
retrieving revision 1.34
diff -u -r1.34 smsc_cimd2.c
--- gw/smsc/smsc_cimd2.c        12 Jan 2009 16:46:50 -0000      1.34
+++ gw/smsc/smsc_cimd2.c        23 Sep 2009 15:59:52 -0000
@@ -2202,6 +2202,7 @@
                       octstr_get_cstr(conn->id));
                 bb_smscconn_receive(conn, msg);
             }
+            if (gwlist_len(pdata->outgoing_queue) > 0) break;
         } while (msg);

         /* send messages */
@@ -2211,6 +2212,7 @@
                 sleep = 0;
                 if (cimd2_submit_msg(conn,msg) != 0) break;
             }
+            if (gwlist_len(pdata->received) > 0) break;
         } while (msg);

         if (sleep > 0) {
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.