updated mmsbox callback interface usage
This commit is contained in:
parent
6cb349ec90
commit
e104515d9b
|
@ -1309,5 +1309,33 @@ Octstr *mm7_soap_header_value(MSoapMsg_t *m, Octstr *header)
|
||||||
|
|
||||||
List *mm7_soap_headers(MSoapMsg_t *m)
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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",
|
mms_error(0, "mms_queue", NULL, "Failed lock temp file %s: error = %s\n",
|
||||||
octstr_get_cstr(tfname), strerror(errno));
|
octstr_get_cstr(tfname), strerror(errno));
|
||||||
res = -1;
|
res = -1;
|
||||||
|
close(fd);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -645,7 +646,7 @@ static int mkqf(char qf[QFNAMEMAX], char subdir[64], char *mms_queuedir)
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
strncpy(qf, octstr_get_cstr(xqf), QFNAMEMAX);
|
strncpy(qf, octstr_get_cstr(xqf), QFNAMEMAX);
|
||||||
|
|
||||||
if (xqf) octstr_destroy(xqf);
|
octstr_destroy(xqf);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue