Hi list,

attached is a very simple change in behavior in being more "runtime" constraining, in case a message in the spool has an invalid 'sms_type' we SHOULD NOT PANIC i.e. but rather dump an ERROR entry and try to continue.

Otherwise we may enter an infinite PANIC/restart loop for cases that such messages get somehow injected to the spool.

If no objections, will be committing soon.

Stipe

--
-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany

tolj.org system architecture      Kannel Software Foundation (KSF)
http://www.tolj.org/              http://www.kannel.org/

mailto:st_{at}_tolj.org           mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------
Index: gw/bearerbox.c
===================================================================
--- gw/bearerbox.c      (revision 5048)
+++ gw/bearerbox.c      (working copy)
@@ -658,6 +658,8 @@
 
 static void dispatch_into_queue(Msg *msg)
 {
+    char id[UUID_STR_LEN + 1];
+
     gw_assert(msg != NULL),
     gw_assert(msg_type(msg) == sms);
 
@@ -672,7 +674,11 @@
             gwlist_append(incoming_sms, msg);
             break;
         default:
-            panic(0, "Not handled sms_type within store!");
+            uuid_unparse(msg->sms.id, id);
+            error(0, "Not handled sms_type %ld within store for message ID %s",
+                  msg->sms.sms_type, id);
+            msg_destroy(msg);
+            break;
     }
 }
 

Reply via email to