1
0
Fork 0

Crash fix in mmsbox related to send-mms http interface bug

This commit is contained in:
bagyenda 2006-01-23 07:11:33 +00:00
parent 5c1107594d
commit 0581db65b4
1 changed files with 8 additions and 7 deletions

View File

@ -699,12 +699,12 @@ static int has_url_scheme(char *url)
static int add_msg_part(MIMEEntity *res, xmlNodePtr node, Octstr *base_url,
Octstr *top_url,
int type, MmsEnvelope *e, Dict *url_map)
int type, Octstr *svc_name, Dict *url_map)
{
Octstr *curl = NULL, *ctype = NULL, *body = NULL;
char *src = NULL;
int isurl, slash_prefix;
MmsService *ms = e->_x;
static int cntr; /* For generating cids */
Octstr *cid = NULL;
@ -757,7 +757,8 @@ static int add_msg_part(MIMEEntity *res, xmlNodePtr node, Octstr *base_url,
ctype = http_header_value(rph, octstr_imm("Content-Type"));
else
error(0, "MMSBOX: Failed to load url %s within SMIL content from service %s!",
octstr_get_cstr(curl), octstr_get_cstr(ms->name));
octstr_get_cstr(curl),
svc_name ? octstr_get_cstr(svc_name) : "unknown");
if (rph)
http_destroy_headers(rph);
http_destroy_headers(rh);
@ -798,14 +799,14 @@ done:
/* Traverse the tree doing the above. */
static void add_msg_parts(MIMEEntity *res, xmlNodePtr node, Octstr *base_url,
Octstr *top_url,
int type, MmsEnvelope *e, Dict *url_map)
int type, Octstr *svc_name, Dict *url_map)
{
xmlNodePtr n;
/* Do all the children recursively, then come back and do parent. */
for (n = node; n; n = n->next)
if (n->type != XML_COMMENT_NODE) {
add_msg_part(res, n, base_url, top_url, type, e, url_map);
add_msg_parts(res, n->xmlChildrenNode, base_url, top_url, type, e, url_map);
add_msg_part(res, n, base_url, top_url, type, svc_name, url_map);
add_msg_parts(res, n->xmlChildrenNode, base_url, top_url, type, svc_name, url_map);
}
}
@ -868,7 +869,7 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
goto done;
}
add_msg_parts(me, smil->xmlChildrenNode, base_url, turl, type, e, url_map);
add_msg_parts(me, smil->xmlChildrenNode, base_url, turl, type, svc_name, url_map);
dict_destroy(url_map);
/* SMIL has been modified, convert it to text, put it in. */