1
0
Fork 0

mime conversion bug affecting content adaption fixed

This commit is contained in:
bagyenda 2005-07-01 05:54:35 +00:00
parent d61af3945f
commit 025c3f507b
7 changed files with 17 additions and 20 deletions

View File

@ -197,7 +197,7 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@ sysconfdir = @sysconfdir@
target_alias = @target_alias@ target_alias = @target_alias@
noinst_LIBRARIES = libmms.a noinst_LIBRARIES = libmms.a
libmms_a_SOURCES = mms_mmbox.h mms_mmbox.c mms_billing.c mms_billing.h mms_msg.c mms_msg.h mms_queue.c mms_queue.h mms_strings.c mms_strings.h mms_uaprof.c mms_uaprof.h mms_util.c mms_util.h mms_resolve.h mms_resolve.c mms_mm7soap.c mms_detokenize.h libmms_a_SOURCES = mms_mmbox.h mms_mmbox.c mms_billing.c mms_billing.h mms_msg.c mms_msg.h mms_queue.c mms_queue.h mms_strings.c mms_strings.h mms_uaprof.c mms_uaprof.h mms_util.c mms_util.h mms_resolve.h mms_resolve.c mms_mm7soap.c mms_detokenize.h mms_mm7soap.h
plugindir = $(libdir)/mbuni plugindir = $(libdir)/mbuni
plugin_LTLIBRARIES = libmms_billing_shell.la libmms_resolve_shell.la libmms_detokenize_shell.la plugin_LTLIBRARIES = libmms_billing_shell.la libmms_resolve_shell.la libmms_detokenize_shell.la
libmms_billing_shell_la_SOURCES = mms_billing_shell.c libmms_billing_shell_la_SOURCES = mms_billing_shell.c

View File

@ -860,7 +860,7 @@ MSoapMsg_t *mm7_mmsmsg_to_soap(MmsMsg *msg, Octstr *from, List *xto,
case MMS_MSGTYPE_SEND_REQ: case MMS_MSGTYPE_SEND_REQ:
case MMS_MSGTYPE_RETRIEVE_CONF: case MMS_MSGTYPE_RETRIEVE_CONF:
m = mm7_soap_create(MM7_TAG_DeliverReq, transid); m = mm7_soap_create(MM7_TAG_DeliverReq, transid);
m->msg = mms_tomime(msg); m->msg = mms_tomime(msg,1);
for (i = 0, n = xto ? list_len(xto) : 0; i < n; i++) { /* Add recipients. */ for (i = 0, n = xto ? list_len(xto) : 0; i < n; i++) { /* Add recipients. */
Octstr *xx = octstr_format("+ %S", list_get(xto, i)); Octstr *xx = octstr_format("+ %S", list_get(xto, i));

View File

@ -1232,7 +1232,7 @@ static void unconvert_mime_msg(MIMEEntity *m)
} }
MIMEEntity *mms_tomime(MmsMsg *msg) MIMEEntity *mms_tomime(MmsMsg *msg, int base64)
{ {
MIMEEntity *m = gw_malloc(sizeof *m); MIMEEntity *m = gw_malloc(sizeof *m);
int i, n; int i, n;
@ -1253,7 +1253,8 @@ MIMEEntity *mms_tomime(MmsMsg *msg)
} }
} }
convert_mime_msg(m); convert_mime_msg(m);
base64_mimeparts(m); if (base64)
base64_mimeparts(m);
return m; return m;
} }
@ -1472,6 +1473,7 @@ MmsMsg *mms_notification(MmsMsg *msg, unsigned int msize, Octstr *url,
} else if (d) \ } else if (d) \
http_header_add(m->headers, #h, d); \ http_header_add(m->headers, #h, d); \
} while(0) } while(0)
if (!optimizesize) { if (!optimizesize) {
HX(From,NULL); HX(From,NULL);
HX(Subject,NULL); HX(Subject,NULL);

View File

@ -44,9 +44,12 @@ extern int mms_messagetype(MmsMsg *msg);
/* /*
* Convert Mms Message to standard Mime entity. * Convert Mms Message to standard Mime entity.
* Does not recode any of the body parts. * Does base64 encoding of binary parts if base64 is true
*/
extern MIMEEntity *mms_tomime(MmsMsg *msg, int base64);
/*
* De-convert from mime.
*/ */
extern MIMEEntity *mms_tomime(MmsMsg *msg);
extern MmsMsg *mms_frommime(MIMEEntity *mime); extern MmsMsg *mms_frommime(MIMEEntity *mime);
extern void mms_msgdump(MmsMsg *m, int headers_only); extern void mms_msgdump(MmsMsg *m, int headers_only);

View File

@ -1002,14 +1002,8 @@ int mms_transform_msg(MmsMsg *inmsg, MmsUaProfile *prof, MmsMsg **outmsg)
else if (!prof->ccppaccept.content) else if (!prof->ccppaccept.content)
return -2; return -2;
m = mms_tomime(inmsg); m = mms_tomime(inmsg,0);
#if 0
mms_msgdump(inmsg);
debug("MMS UA PROF", 0, "### in ua prof");
mime_entity_dump(m);
#endif
modify_msg(m, prof); modify_msg(m, prof);
*outmsg = mms_frommime(m); *outmsg = mms_frommime(m);
@ -1318,7 +1312,7 @@ int mms_format_special(MmsMsg *inmsg,
char *txtmsg, char *txtmsg,
char *htmlmsg, MIMEEntity **outmsg) char *htmlmsg, MIMEEntity **outmsg)
{ {
MIMEEntity *m = mms_tomime(inmsg); MIMEEntity *m = mms_tomime(inmsg,0);
int ct = 0; int ct = 0;
if (!m) if (!m)
@ -1327,9 +1321,7 @@ int mms_format_special(MmsMsg *inmsg,
format_special(m, trans_smil, txtmsg, htmlmsg, &ct); format_special(m, trans_smil, txtmsg, htmlmsg, &ct);
*outmsg = m; *outmsg = m;
return 0; return 0;
} }
extern unsigned long mms_ua_maxmsgsize(MmsUaProfile *prof) extern unsigned long mms_ua_maxmsgsize(MmsUaProfile *prof)

View File

@ -42,7 +42,7 @@ extern int mms_transform_msg(MmsMsg *inmsg, MmsUaProfile *prof, MmsMsg **outmsg)
/* Transforms the mms into a more 'readable' format: /* Transforms the mms into a more 'readable' format:
* SMIL is turned into html (with an alternative of text) if trans_smil is set, * SMIL is turned into html (with an alternative of text) if trans_smil is set,
* image and audio changed to email preferred formats. * image and audio changed to email preferred formats. Does not base64 mime parts of result!
*/ */
extern int mms_format_special(MmsMsg *inmsg, extern int mms_format_special(MmsMsg *inmsg,
int trans_smil, int trans_smil,

View File

@ -995,7 +995,7 @@ int mms_sendtoemail(Octstr *from, Octstr *to,
} }
if (!trans_msg) if (!trans_msg)
m = mms_tomime(msg); m = mms_tomime(msg,0);
else else
if ((ret = mms_format_special(msg, trans_smil, txt, html, &m)) < 0 || if ((ret = mms_format_special(msg, trans_smil, txt, html, &m)) < 0 ||
m == NULL) { m == NULL) {
@ -1004,7 +1004,7 @@ int mms_sendtoemail(Octstr *from, Octstr *to,
return -ret; return -ret;
} }
base64_mimeparts(m); base64_mimeparts(m); /* make sure parts are base64 formatted. */
/* Before we send it, we insert some email friendly headers if they are missing. */ /* Before we send it, we insert some email friendly headers if they are missing. */
http_header_add(newhdrs, "Subject", subject ? octstr_get_cstr(subject) : "MMS Message"); http_header_add(newhdrs, "Subject", subject ? octstr_get_cstr(subject) : "MMS Message");