[PATCH] EMI

Nisan Bloch <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi

Here is a patch to fix the problem of Kannel not respecting the window size 
setting.  The constant EMI2_MAX_TRN was been used for all limits and the 
mod function to find a new free slot/window, rather than the window setting.

Nisan

--- cvs/gateway/gw/smsc/smsc_emi2.c     Thu Dec  5 19:03:57 2002
+++ ./smsc_emi2.c       Thu Dec  5 22:34:20 2002
@@ -780,7 +780,7 @@
      int i;
      debug("smsc.emi2", 0, "EMI2[%s]: clear_sent called",
           octstr_get_cstr(privdata->name));
-    for (i = 0; i < EMI2_MAX_TRN; i++) {
+    for (i = 0; i < privdata->window; i++) {
         if (privdata->slots[i].sendtime && privdata->slots[i].sendtype == 51)
             list_produce(privdata->outgoing_queue, 
privdata->slots[i].sendmsg);
         privdata->slots[i].sendtime = 0;
@@ -816,7 +816,7 @@
   */
  static int emi2_next_trn (SMSCConn *conn)
  {
-#define INC_TRN(x) ((x)=((x) + 1) % EMI2_MAX_TRN)
+#define INC_TRN(x) ((x)=((x) + 1) % privdata->window)
      int result;

      while (SLOTBUSY(conn,PRIVDATA(conn)->priv_nexttrn))
@@ -1121,7 +1121,7 @@

      if (PRIVDATA(conn)->unacked && (current_time > 
(PRIVDATA(conn)->check_time + 30))) {
         PRIVDATA(conn)->check_time = current_time;
-       for (i = 0; i < EMI2_MAX_TRN; i++) {
+       for (i = 0; i < privdata->window; i++) {
             if (SLOTBUSY(conn,i)
                 && PRIVDATA(conn)->slots[i].sendtime < (current_time - 
PRIVDATA(conn)->waitack)) {
                 PRIVDATA(conn)->slots[i].sendtime = 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.