diff --git a/mbuni/mmlib/mms_mm7soap.c b/mbuni/mmlib/mms_mm7soap.c index f70a30f..00c88cf 100644 --- a/mbuni/mmlib/mms_mm7soap.c +++ b/mbuni/mmlib/mms_mm7soap.c @@ -752,14 +752,18 @@ MmsMsg *mm7_soap_to_mmsmsg(MSoapMsg_t *m, Octstr *from) } if ((s = http_header_value(m->envelope, octstr_imm("DeliveryReport"))) != NULL) { - if (mms_string_to_reports(s) >= 0) - mms_replace_header_value(msg, "X-Mms-Delivery-Report", octstr_get_cstr(s)); + long x = mms_string_to_boolean_flag(s); + if (x >= 0) + mms_replace_header_value(msg, "X-Mms-Delivery-Report", + (char *)mms_reports_to_cstr(x)); octstr_destroy(s); } if ((s = http_header_value(m->envelope, octstr_imm("ReadReply"))) != NULL) { - if (mms_string_to_reports(s) >= 0) - mms_replace_header_value(msg, "X-Mms-Read-Report", octstr_get_cstr(s)); + long x = mms_string_to_boolean_flag(s); + if (x >= 0) + mms_replace_header_value(msg, "X-Mms-Read-Report", + (char *)mms_reports_to_cstr(x)); octstr_destroy(s); } diff --git a/mbuni/mmlib/mms_strings.def b/mbuni/mmlib/mms_strings.def index 0f93c77..4a393a7 100644 --- a/mbuni/mmlib/mms_strings.def +++ b/mbuni/mmlib/mms_strings.def @@ -116,6 +116,12 @@ STRING("Yes") STRING("No") ) +/* the ones below are wired to agree with flags above. */ +LINEAR(boolean_flag, +STRING("true") +STRING("false") +) + NAMED(message_type, VNSTRING(MS_1_1,"m-send-req", MMS_MSGTYPE_SEND_REQ) VNSTRING(MS_1_1,"m-send-conf", MMS_MSGTYPE_SEND_CONF) diff --git a/mbuni/mmlib/mms_uaprof.c b/mbuni/mmlib/mms_uaprof.c index 4f8bcc8..d11c20c 100644 --- a/mbuni/mmlib/mms_uaprof.c +++ b/mbuni/mmlib/mms_uaprof.c @@ -362,14 +362,6 @@ static int unreplace_slash(int ch) return (ch == '$') ? '/' : ch; } -#define UACOUNT_PROFILE 1023 -static void init_profiledict(void) -{ - if (!profile_dict) - profile_dict = dict_create(UACOUNT_PROFILE, (void (*)(void *))destroy_uaprof); -} - - static int mms_load_ua_profile_cache(char *dir) { @@ -488,13 +480,20 @@ static MmsUaProfile *profile_fetch(Octstr *profile_url) } static void init_format_table(void); - +#define UACOUNT_PROFILE 1023 int mms_start_profile_engine(char *cache_dir) { - init_profiledict(); + if (profile_dict) + return 0; + + profile_dir = octstr_create(cache_dir); + + if (!profile_dict) + profile_dict = dict_create(UACOUNT_PROFILE, + (void (*)(void *))destroy_uaprof); init_format_table(); mms_load_ua_profile_cache(cache_dir); - profile_dir = octstr_create(cache_dir); + return 0; } @@ -505,6 +504,7 @@ int mms_stop_profile_engine(void) if (profile_dir) octstr_destroy(profile_dir); dict_destroy(profile_dict); + profile_dict = NULL; return 0; }