Skip to content

Commit

Permalink
presence_dialoginfo : aux_body should return xmldoc instead of char
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo committed Dec 17, 2015
1 parent 412f155 commit b6b7de8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions modules/presence/notify.c
Expand Up @@ -1535,8 +1535,7 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,
{
aux_body = subs->event->aux_body_processing(subs, notify_body);
if(aux_body) {
xmlFree(notify_body->s);
pkg_free(notify_body);
free_notify_body(notify_body, subs->event);
notify_body = aux_body;
}
}
Expand Down
13 changes: 13 additions & 0 deletions modules/presence_dialoginfo/notify_body.c
Expand Up @@ -595,5 +595,18 @@ str *dlginfo_body_setversion(subs_t *subs, str *body) {
memcpy(version_start, version, version_len);
memset(version_start + version_len, ' ', 12 - version_len);

xmlDocPtr doc = xmlReadMemory(aux_body->s, aux_body->len, "noname.xml", NULL, 0);
if (doc == NULL) {
LM_ERR("error allocation xmldoc\n");
pkg_free(aux_body->s);
pkg_free(aux_body);
return NULL;
}
pkg_free(aux_body->s);
xmlDocDumpFormatMemory(doc,(xmlChar**)(void*)&aux_body->s, &aux_body->len, 1);

xmlCleanupParser();
xmlMemoryDump();

return aux_body;
}

0 comments on commit b6b7de8

Please sign in to comment.