From 79b19bac6499f9c5a1654cddceb2824782ac10eb Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Thu, 13 Jul 2006 12:01:24 +0000 Subject: [PATCH] - Minor fix for ? char in sendsms url - Minor fix for default queue run interval (was 0.1, now 5 secs) --- mbuni/doc/examples/mmsbox.conf | 2 +- mbuni/doc/examples/mmsc.conf | 2 +- mbuni/mmlib/mms_util.c | 11 ++++------- mbuni/mmsc/mmsc_cfg.c | 8 +++++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mbuni/doc/examples/mmsbox.conf b/mbuni/doc/examples/mmsbox.conf index 0ad3726..d84b243 100644 --- a/mbuni/doc/examples/mmsbox.conf +++ b/mbuni/doc/examples/mmsbox.conf @@ -8,7 +8,7 @@ storage-directory = /tmp/spool max-send-threads = 5 maximum-send-attempts = 50 default-message-expiry = 360000 -queue-run-interval = 0.1 +queue-run-interval = 5 send-attempt-back-off = 300 sendmms-port = 10001 diff --git a/mbuni/doc/examples/mmsc.conf b/mbuni/doc/examples/mmsc.conf index 50b33a7..4fe7deb 100644 --- a/mbuni/doc/examples/mmsc.conf +++ b/mbuni/doc/examples/mmsc.conf @@ -14,7 +14,7 @@ send-mail-prog = /usr/sbin/sendmail -f '%f' '%t' unified-prefix = "+25637,037,37" maximum-send-attempts = 50 default-message-expiry = 360000 -queue-run-interval = 0.1 +queue-run-interval = 5 send-attempt-back-off = 300 sendsms-url = http://localhost:13013/cgi-bin/sendsms sendsms-username = tester diff --git a/mbuni/mmlib/mms_util.c b/mbuni/mmlib/mms_util.c index 55c9a97..27408fd 100644 --- a/mbuni/mmlib/mms_util.c +++ b/mbuni/mmlib/mms_util.c @@ -1008,12 +1008,11 @@ int parse_cgivars(List *request_headers, Octstr *request_body, /* Go through body parts, pick out what we need. */ for (i = 0, n = list_len(m->multiparts); i < n; i++) { MIMEEntity *mp = list_get(m->multiparts, i); - Octstr *cd = http_header_value(mp->headers, octstr_imm("Content-Disposition")); + Octstr *ct = http_header_value(mp->headers, + octstr_imm("Content-Type")); + Octstr *cd = http_header_value(mp->headers, + octstr_imm("Content-Disposition")); Octstr *name = http_get_header_parameter(cd, octstr_imm("name")); - Octstr *ct = NULL, *ch = NULL; - - http_header_get_content_type(mp->headers, &ct, &ch); - if (name) { HTTPCGIVar *x = gw_malloc(sizeof *x); @@ -1037,8 +1036,6 @@ int parse_cgivars(List *request_headers, Octstr *request_body, } octstr_destroy(name); } - if (ch) - octstr_destroy(ch); if (ct) octstr_destroy(ct); diff --git a/mbuni/mmsc/mmsc_cfg.c b/mbuni/mmsc/mmsc_cfg.c index 778ddf3..60d7790 100644 --- a/mbuni/mmsc/mmsc_cfg.c +++ b/mbuni/mmsc/mmsc_cfg.c @@ -167,11 +167,13 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays) if (from && octstr_len(from) > 1) octstr_url_encode(from); - + + i = octstr_search_char(m->sendsms_url, '?', 0); /* If ? is in there, omit below. */ octstr_format_append(m->sendsms_url, (from && octstr_len(from) > 1) ? - "?username=%S&password=%S&from=%S" : - "?username=%S&password=%S", + "%susername=%S&password=%S&from=%S" : + "%susername=%S&password=%S", + (i >= 0) ? "" : "?", user, pass,from);