hi aarno and kannel developpers,
I've started testing the push part of Kannel and I found bugs in pap_compiler.c.
I propose fixes
The code I added or modified finishes with /* BVL */
bug 1 : With my release of libxml (one of the most recent one) which is needed to fix
a problem I found (see a previous email),
we need to modify this part of the code :
switch (node->type) {
case XML_COMMENT_NODE: /* ignore comments and pi nodes */
case XML_PI_NODE:
case XML_TEXT_NODE: /* BVL - ignore text nodes */
break;
Bug 2 : ppg-notify-requested-to misses :
{ "source-reference", NULL },
{ "progress-notes-requested", "true" },
{ "ppg-notify-requested-to", NULL }, /* BVL */
{ "progress-notes-requested", "false" },
{ "address-value", NULL },
Bug 3 : Prevent crashes in some cases :
/*
* Parse an attribute (it is, check cdata is has for a value) that is *not* an
* enumeration. Legal values are defined in PAP, chapter 9.
*/
if (pap_attributes[i].value == NULL) {
ret = parse_attr_value(element_name, attr_name, value, e);
goto parsed;
}
while (octstr_compare(attr_name, nameos = octstr_imm(pap_attributes[i].name)) ==
0) { /* BVL - add = oct... */
if (octstr_str_compare(value, pap_attributes[i].value) == 0)
break;
i++;
}
End of bug fixes propositions.
Moreover, in this file, aarno often uses octstr_compare, for exemple :
if (octstr_compare(element_name, octstr_imm("push-message")) == 0)
I think, it would be better to use octstr_str_compare, for example :
if (octstr_str_compare(element_name, "push-message") == 0) /* BVL */
The code would be shorter and maybe faster ?
what do you think of that ?
Bernard Valton
YacCom