1
0
Fork 0

updated mmsbox callback interface usage

This commit is contained in:
bagyenda 2010-11-05 06:26:49 +00:00
parent 6cb349ec90
commit e104515d9b
2 changed files with 31 additions and 2 deletions

View File

@ -1309,5 +1309,33 @@ Octstr *mm7_soap_header_value(MSoapMsg_t *m, Octstr *header)
List *mm7_soap_headers(MSoapMsg_t *m)
{
return m ? http_header_duplicate(m->envelope) : NULL;
List *l;
int i;
if (m == NULL)
return NULL;
l = http_create_empty_headers();
for (i = 0; i < gwlist_len(m->envelope); i++) {
Octstr *n = NULL, *v = NULL;
http_header_get(m->envelope, i, &n, &v);
if (!n || !v)
goto loop;
if (octstr_str_case_compare(n, "From") == 0 ||
octstr_str_case_compare(n, "To") == 0 ||
octstr_str_case_compare(n, "Sender") == 0 ||
octstr_str_case_compare(n, "Cc") == 0 ||
octstr_str_case_compare(n, "Bcc") == 0 ||
octstr_str_case_compare(n, "SenderAddress") == 0) {
if (octstr_get_char(v, 0) == '+')
octstr_delete(v, 0, 2);
}
http_header_add(l, octstr_get_cstr(n), octstr_get_cstr(v));
loop:
octstr_destroy(n);
octstr_destroy(v);
}
return l;
}

View File

@ -427,6 +427,7 @@ static int writeenvelope(MmsEnvelope *e, int newenv)
mms_error(0, "mms_queue", NULL, "Failed lock temp file %s: error = %s\n",
octstr_get_cstr(tfname), strerror(errno));
res = -1;
close(fd);
goto done;
}
}
@ -645,7 +646,7 @@ static int mkqf(char qf[QFNAMEMAX], char subdir[64], char *mms_queuedir)
if (fd >= 0)
strncpy(qf, octstr_get_cstr(xqf), QFNAMEMAX);
if (xqf) octstr_destroy(xqf);
octstr_destroy(xqf);
return fd;
}