another emi2 bugfix

"Kaido Karner" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
re

emi2 smsc connections by mistake increase received messages counter twice.

patch is together with the previous fix in smsc_emi2.c


diff -u gateway-1.2.0/gw/smsc_emi2.c gateway-patched/gw/smsc_emi2.c 
--- gateway-1.2.0/gw/smsc_emi2.c        Fri Jun 28 14:09:54 2002
+++ gateway-patched/gw/smsc_emi2.c      Mon Jul 22 13:29:15 2002
@@ -670,7 +670,6 @@
        }
 
        msg->sms.smsc_id = octstr_duplicate(conn->id);
-       counter_increase(conn->received);
        bb_smscconn_receive(conn, msg);
        reply = emimsg_create_reply(52, emimsg->trn, 1, privdata->name);
        if (emi2_emimsg_send(conn, server, reply) < 0) {
@@ -1606,8 +1605,6 @@
     privdata->deny_ip = deny_ip;
 
     if (privdata->rport > 0 && emi2_open_listening_socket(privdata) < 0) {
-       gw_free(privdata);
-       privdata = NULL;
        goto error;
     }
 
@@ -1651,12 +1648,13 @@
     if (privdata != NULL) {
        list_destroy(privdata->outgoing_queue, NULL);
     }
-    gw_free(privdata);
     octstr_destroy(allow_ip);
     octstr_destroy(deny_ip);
     octstr_destroy(host);
     conn->why_killed = SMSCCONN_KILLED_CANNOT_CONNECT;
     conn->status = SMSCCONN_DEAD;
     info(0, "EMI2[%s]: exiting", octstr_get_cstr(privdata->name));
+    gw_free(privdata);
+    privdata = NULL;
     return -1;
 }



kaido
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.