added application/vnd.mbuni.url-list
This commit is contained in:
parent
b99cbd96fa
commit
590444539c
|
@ -1,3 +1,5 @@
|
||||||
|
2008-07-15 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
* Added file type application/vnd.mbuni.url-list for basic multipart/mixed type
|
||||||
2008-07-10 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2008-07-10 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
* Fixed minimum size of pgsql connection pool
|
* Fixed minimum size of pgsql connection pool
|
||||||
* Fix for shutdown procedure
|
* Fix for shutdown procedure
|
||||||
|
|
|
@ -24,7 +24,7 @@ AC_MSG_RESULT([$M_VERSION])
|
||||||
|
|
||||||
AC_CONFIG_SRCDIR([mmlib/mms_util.c])
|
AC_CONFIG_SRCDIR([mmlib/mms_util.c])
|
||||||
AC_CONFIG_AUX_DIR(autotools)
|
AC_CONFIG_AUX_DIR(autotools)
|
||||||
AM_INIT_AUTOMAKE([mbuni],[cvs])
|
AM_INIT_AUTOMAKE([mbuni],[$M_VERSION])
|
||||||
AC_CONFIG_HEADERS([mbuni-config.h])
|
AC_CONFIG_HEADERS([mbuni-config.h])
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
|
|
@ -135,7 +135,7 @@ RANLIB = ranlib
|
||||||
SET_MAKE =
|
SET_MAKE =
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
STRIP = strip
|
STRIP = strip
|
||||||
VERSION = cvs
|
VERSION = 1.4.0
|
||||||
ac_ct_CC = gcc
|
ac_ct_CC = gcc
|
||||||
ac_ct_CXX = g++
|
ac_ct_CXX = g++
|
||||||
ac_ct_F77 =
|
ac_ct_F77 =
|
||||||
|
|
|
@ -1345,12 +1345,15 @@ static struct {
|
||||||
{"audio/midi", "mid"},
|
{"audio/midi", "mid"},
|
||||||
{"audio/sp-midi", "mid"},
|
{"audio/sp-midi", "mid"},
|
||||||
{"application/smil", "smil"},
|
{"application/smil", "smil"},
|
||||||
|
{"application/smil", "smi"},
|
||||||
{"application/vnd.wap.mms-message", "mms"},
|
{"application/vnd.wap.mms-message", "mms"},
|
||||||
{"application/java-archive", "jar"},
|
{"application/java-archive", "jar"},
|
||||||
{"video/3gpp", "3gp2"},
|
{"video/3gpp", "3gp2"},
|
||||||
{"video/3gpp", "3gp"},
|
{"video/3gpp", "3gp"},
|
||||||
{"video/3gpp2", "3g2"},
|
{"video/3gpp2", "3g2"},
|
||||||
{"audio/vnd.qcelp", "qcp"},
|
{"audio/vnd.qcelp", "qcp"},
|
||||||
|
|
||||||
|
{MBUNI_MULTIPART_TYPE, "urls"}, /* mbuni url list type. */
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1895,3 +1898,60 @@ void add_multipart_form_field(MIMEEntity *multipart, char *field_name, char *cty
|
||||||
octstr_destroy(cd);
|
octstr_destroy(cd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MIMEEntity *multipart_from_urls(List *url_list)
|
||||||
|
{
|
||||||
|
int i, n;
|
||||||
|
List *rh = http_create_empty_headers();
|
||||||
|
MIMEEntity *m = mime_entity_create();
|
||||||
|
|
||||||
|
http_header_add(rh, "User-Agent", MM_NAME "/" VERSION);
|
||||||
|
for (i = 0, n = gwlist_len(url_list); i<n; i++) {
|
||||||
|
List *rph = NULL;
|
||||||
|
Octstr *rbody = NULL;
|
||||||
|
Octstr *url = gwlist_get(url_list, i);
|
||||||
|
if (mms_url_fetch_content(HTTP_METHOD_GET,
|
||||||
|
url, rh, NULL, &rph, &rbody) == HTTP_OK) {
|
||||||
|
List *mh = http_create_empty_headers();
|
||||||
|
Octstr *x;
|
||||||
|
MIMEEntity *mx;
|
||||||
|
|
||||||
|
if ((x = http_header_value(rph, octstr_imm("Content-Type"))) != NULL) {
|
||||||
|
http_header_add(mh, "Content-Type", octstr_get_cstr(x));
|
||||||
|
octstr_destroy(x);
|
||||||
|
} else
|
||||||
|
http_header_add(mh, "Content-Type", "application/content-stream");
|
||||||
|
|
||||||
|
if ((x = http_header_value(rph, octstr_imm("Content-ID"))) != NULL) {
|
||||||
|
http_header_add(mh, "Content-ID", octstr_get_cstr(x));
|
||||||
|
octstr_destroy(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((x = http_header_value(rph, octstr_imm("Content-Location"))) != NULL) {
|
||||||
|
http_header_add(mh, "Content-Location", octstr_get_cstr(x));
|
||||||
|
octstr_destroy(x);
|
||||||
|
}
|
||||||
|
mx = mime_http_to_entity(mh, rbody);
|
||||||
|
|
||||||
|
mime_entity_add_part(m, mx);
|
||||||
|
|
||||||
|
http_destroy_headers(mh);
|
||||||
|
mime_entity_destroy(mx);
|
||||||
|
} else
|
||||||
|
error(0, "multipart_from_urls: Failed to load URL content for URL [%s]",
|
||||||
|
octstr_get_cstr(url));
|
||||||
|
octstr_destroy(rbody);
|
||||||
|
http_destroy_headers(rph);
|
||||||
|
}
|
||||||
|
|
||||||
|
http_destroy_headers(rh);
|
||||||
|
|
||||||
|
/* Now change the content type on this baby. */
|
||||||
|
rh = http_create_empty_headers();
|
||||||
|
http_header_add(rh, "Content-Type", "multipart/mixed");
|
||||||
|
mime_replace_headers(m, rh);
|
||||||
|
|
||||||
|
http_destroy_headers(rh);
|
||||||
|
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#define _TT "0123456789abcdefghijklmnopqrstuvwxyz"
|
#define _TT "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
#define _TTSIZE (-1 + sizeof _TT)
|
#define _TTSIZE (-1 + sizeof _TT)
|
||||||
|
|
||||||
|
#define MBUNI_MULTIPART_TYPE "application/vnd.vnd.mbuni.url-list"
|
||||||
|
|
||||||
/* Global variables and shared code used by all modules. */
|
/* Global variables and shared code used by all modules. */
|
||||||
|
|
||||||
|
@ -219,6 +220,9 @@ void add_multipart_form_field(MIMEEntity *multipart, char *field_name,
|
||||||
char *ctype, char *content_loc,
|
char *ctype, char *content_loc,
|
||||||
Octstr *data);
|
Octstr *data);
|
||||||
|
|
||||||
|
/* Build a multipart message from a list of URLs. Fetch each one and add. Result is a multipart/mixed message. */
|
||||||
|
MIMEEntity *multipart_from_urls(List *url_list);
|
||||||
|
|
||||||
/* load a shared object, then load a symbol from it. */
|
/* load a shared object, then load a symbol from it. */
|
||||||
void *_mms_load_module(mCfgGrp *grp, char *config_key, char *symbolname,
|
void *_mms_load_module(mCfgGrp *grp, char *config_key, char *symbolname,
|
||||||
void *shell_builtin);
|
void *shell_builtin);
|
||||||
|
|
|
@ -4,4 +4,4 @@ bin_PROGRAMS = mmsbox
|
||||||
mmsbox_SOURCES = mmsbox.c mmsbox_cfg.c dlr.c bearerbox.c mmsbox_resolve.c mmsbox_resolve_shell.c
|
mmsbox_SOURCES = mmsbox.c mmsbox_cfg.c dlr.c bearerbox.c mmsbox_resolve.c mmsbox_resolve_shell.c
|
||||||
mmsbox_LDADD = $(libmms)
|
mmsbox_LDADD = $(libmms)
|
||||||
|
|
||||||
EXTRA_DIST = mmsbox_cfg.h mmsbox.h mmsbox_mt_filter.h mmsbox_resolve.h mmsbox_mmsc.h
|
EXTRA_DIST = mmsbox_cfg.h mmsbox.h mmsbox_mt_filter.h mmsbox_resolve_shell.h mmsbox_resolve.h mmsbox_mmsc.h
|
||||||
|
|
|
@ -306,17 +306,13 @@ done:
|
||||||
octstr_destroy(cd);
|
octstr_destroy(cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xctype)
|
|
||||||
octstr_destroy(xctype);
|
|
||||||
if (params)
|
|
||||||
octstr_destroy(params);
|
|
||||||
if (ctype)
|
|
||||||
octstr_destroy(ctype);
|
|
||||||
|
|
||||||
if (data)
|
octstr_destroy(xctype);
|
||||||
octstr_destroy(data);
|
octstr_destroy(params);
|
||||||
if (headers)
|
octstr_destroy(ctype);
|
||||||
http_destroy_headers(headers);
|
octstr_destroy(data);
|
||||||
|
|
||||||
|
http_destroy_headers(headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum _xurltype {FILE_TYPE, URL_TYPE};
|
enum _xurltype {FILE_TYPE, URL_TYPE};
|
||||||
|
@ -952,9 +948,18 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
||||||
else if (octstr_case_search(ctype, octstr_imm("multipart/"), 0) == 0) { /* treat it differently. */
|
else if (octstr_case_search(ctype, octstr_imm("multipart/"), 0) == 0) { /* treat it differently. */
|
||||||
MIMEEntity *mime = mime_http_to_entity(reply_headers, data);
|
MIMEEntity *mime = mime_http_to_entity(reply_headers, data);
|
||||||
if (mime) {
|
if (mime) {
|
||||||
m = mms_frommime(mime);
|
mime_entity_destroy(me);
|
||||||
mime_entity_destroy(mime);
|
me = mime;
|
||||||
}
|
}
|
||||||
|
} else if (octstr_case_search(ctype, octstr_imm(MBUNI_MULTIPART_TYPE), 0) == 0) { /* Mbuni multipart.*/
|
||||||
|
List *l = octstr_split_words(data);
|
||||||
|
MIMEEntity *mime = multipart_from_urls(l);
|
||||||
|
|
||||||
|
if (mime) {
|
||||||
|
mime_entity_destroy(me);
|
||||||
|
me = mime;
|
||||||
|
}
|
||||||
|
gwlist_destroy(l, (void *)octstr_destroy);
|
||||||
} else if (octstr_case_search(ctype, octstr_imm("application/smil"), 0) == 0) {
|
} else if (octstr_case_search(ctype, octstr_imm("application/smil"), 0) == 0) {
|
||||||
xmlDocPtr smil;
|
xmlDocPtr smil;
|
||||||
xmlChar *buf = NULL;
|
xmlChar *buf = NULL;
|
||||||
|
|
Loading…
Reference in New Issue