patch for empy message and UDH > 140
Oleg Titov <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Organization | Aleph Technology [http://www.aleph-tec.com] |
| Message-ID | <[email protected]> |
hi, please check out this patch used to solve the "empty" message and kannel smsbox crash on UDH > 140. First part of the patch checks for the presence of the text message and UDH header, now it should be possible to send pure UDH messages (without "<Empty ..." string as text). Second part, checks for UDH length, if it more than 140 - the reject message will be sent to http interface. -- Best regards, Oleg
smsbox.patch
(application/octet-stream, 941 B)
Index: smsbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsbox.c,v
retrieving revision 1.221
diff -u -r1.221 smsbox.c
--- smsbox.c 27 Mar 2003 19:51:47 -0000 1.221
+++ smsbox.c 5 May 2003 15:36:31 -0000
@@ -199,7 +199,7 @@
/* Empty message? Either ignore it or substitute the "empty"
* warning defined */
- if (octstr_len(msg->sms.msgdata) == 0) {
+ if ((octstr_len(msg->sms.msgdata) == 0) && (octstr_len(msg->sms.udhdata) == 0)) {
if (trans != NULL && urltrans_omit_empty(trans))
return 0;
else
@@ -1741,6 +1741,10 @@
returnerror = octstr_create("UDH field misformed, rejected");
goto fielderror2;
}
+ if (udh != NULL && (octstr_len(udh) > 140)) {
+ returnerror = octstr_create("UDH field is too long, rejected");
+ goto fielderror2;
+ }
/*
* Check for white and black lists, first for the URLTranlation