Hello,
Please find attached a patch containing three small RLS bug fixes:
1) A string comparison that fails because sometimes one of the strings
is '\0' terminated and the other never is.
2) A fix for when some non-RLS SUBSCRIBEs are not identified as such.
3) A fix for a small typo in an error diagnostic.
Regards,
Peter
--
Peter Dunkley
Technical Director
Crocodile RCS Ltd
Common subdirectories: rls-orig/doc and rls/doc
diff -u rls-orig/subscribe.c rls/subscribe.c
--- rls-orig/subscribe.c 2011-04-21 16:31:57.388459917 +0100
+++ rls/subscribe.c 2011-04-21 16:28:38.041774499 +0100
@@ -90,7 +90,7 @@
val = XMLNodeGetAttrContentByName(node, "uri");
if(val!=NULL)
{
- if((uri->len==strlen(val)) && (strcmp(val, uri->s)==0))
+ if((uri->len==strlen(val)) && (strncmp(val, uri->s, uri->len)==0))
{
xmlFree(val);
return node;
@@ -241,13 +241,17 @@
*service_node = rls_get_by_service_uri(xmldoc, service_uri);
if(*service_node==NULL)
{
- LM_ERR("service uri %.*s not found in rl document for user"
+ LM_DBG("service uri %.*s not found in rl document for user"
" sip:%.*s@%.*s\n", service_uri->len, service_uri->s,
user->len, user->s, domain->len, domain->s);
- goto error;
+ rootdoc = NULL;
+ if(xmldoc!=NULL)
+ xmlFreeDoc(xmldoc);
+ }
+ else
+ {
+ *rootdoc = xmldoc;
}
-
- *rootdoc = xmldoc;
rls_dbf.free_result(rls_db, result);
if(xcapdoc!=NULL)
@@ -621,7 +625,7 @@
if(send_full_notify(&subs, service_node, subs.version, &subs.pres_uri,
hash_code)<0)
{
- LM_ERR("failed sending full state sotify\n");
+ LM_ERR("failed sending full state notify\n");
goto error;
}
/* send subscribe requests for all in the list */
Only in rls: subscribe.c.orig
Only in rls: .svn
_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev