From 0581db65b423551b5c98b2a7e7c1cd26880ff9d3 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Mon, 23 Jan 2006 07:11:33 +0000 Subject: [PATCH] Crash fix in mmsbox related to send-mms http interface bug --- mbuni/mmsbox/mmsbox.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mbuni/mmsbox/mmsbox.c b/mbuni/mmsbox/mmsbox.c index ff81482..45dade9 100644 --- a/mbuni/mmsbox/mmsbox.c +++ b/mbuni/mmsbox/mmsbox.c @@ -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. */