Misc. error format cleanups
This commit is contained in:
parent
5af2e53f30
commit
eb1a689a8a
|
@ -598,7 +598,7 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
value_error:
|
value_error:
|
||||||
warning(0, "Skipping faulty header [code = %d, val=%d]!", field_type, val);
|
warning(0, "Skipping faulty header [code=%d, val=%d]!", field_type, val);
|
||||||
octstr_destroy(decoded);
|
octstr_destroy(decoded);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
MSoapMsg_t *mreq = NULL, *mresp = NULL;
|
MSoapMsg_t *mreq = NULL, *mresp = NULL;
|
||||||
int hstatus = HTTP_OK;
|
int hstatus = HTTP_OK;
|
||||||
List *rh = NULL;
|
List *rh = NULL;
|
||||||
Octstr *reply_body = NULL, *value;
|
Octstr *reply_body = NULL, *value, *desc;
|
||||||
|
|
||||||
List *to = NULL;
|
List *to = NULL;
|
||||||
Octstr *from = NULL, *subject = NULL, *vasid = NULL, *msgid = NULL;
|
Octstr *from = NULL, *subject = NULL, *vasid = NULL, *msgid = NULL;
|
||||||
|
@ -197,11 +197,17 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MM7_TAG_DeliveryReportReq:
|
case MM7_TAG_DeliveryReportReq:
|
||||||
|
desc = mm7_soap_header_value(mreq, octstr_imm("StatusText"));
|
||||||
msgid = mm7_soap_header_value(mreq, octstr_imm("MessageID"));
|
msgid = mm7_soap_header_value(mreq, octstr_imm("MessageID"));
|
||||||
value = mm7_soap_header_value(mreq, octstr_imm("MMStatus"));
|
value = mm7_soap_header_value(mreq, octstr_imm("MMStatus"));
|
||||||
|
|
||||||
|
info(0, "Sending delivery-report [FROM:%s] [VALUE:%s] [DESC:%s] [MSGID:%s]",
|
||||||
|
octstr_get_cstr(from), octstr_get_cstr(value), octstr_get_cstr(desc),
|
||||||
|
octstr_get_cstr(h->m->id));
|
||||||
send_report(from, "delivery-report", value, msgid, h->m->id);
|
send_report(from, "delivery-report", value, msgid, h->m->id);
|
||||||
|
|
||||||
|
if (desc)
|
||||||
|
octstr_destroy(desc);
|
||||||
if (value)
|
if (value)
|
||||||
octstr_destroy(value);
|
octstr_destroy(value);
|
||||||
mms_log("DeliveryReport",
|
mms_log("DeliveryReport",
|
||||||
|
@ -235,7 +241,7 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
http_close_client(h->client);
|
http_close_client(h->client);
|
||||||
|
|
||||||
debug("mmsbox.mm7sendinterface", 0,
|
debug("mmsbox.mm7sendinterface", 0,
|
||||||
" --> leaving mm7dispatch interface, mresp=%s, body=%s, mm7_status=%d <-- ",
|
" --> leaving mm7dispatch interface, mresp=[%s], body=[%s], mm7_status=[%d] <-- ",
|
||||||
mresp ? "ok" : "(null)",
|
mresp ? "ok" : "(null)",
|
||||||
reply_body ? "ok" : "(null)", status);
|
reply_body ? "ok" : "(null)", status);
|
||||||
|
|
||||||
|
@ -287,7 +293,7 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
||||||
int mtype;
|
int mtype;
|
||||||
|
|
||||||
debug("mmsbox.mm7eaif.sendinterface", 0,
|
debug("mmsbox.mm7eaif.sendinterface", 0,
|
||||||
" --> Enterred eaif send interface, blen=%d <--- ",
|
" --> Enterred eaif send interface, blen=[%d] <--- ",
|
||||||
msize);
|
msize);
|
||||||
|
|
||||||
hfrom = http_header_value(h->headers, octstr_imm("X-NOKIA-MMSC-From"));
|
hfrom = http_header_value(h->headers, octstr_imm("X-NOKIA-MMSC-From"));
|
||||||
|
@ -450,9 +456,10 @@ void mmsc_receive_func(MmscGrp *m)
|
||||||
|
|
||||||
h.ua = http_header_value(h.headers, octstr_imm("User-Agent"));
|
h.ua = http_header_value(h.headers, octstr_imm("User-Agent"));
|
||||||
debug("mmsbox", 0,
|
debug("mmsbox", 0,
|
||||||
" MM7 Incoming, ip=%s, mmsc id=%s ",
|
" MM7 Incoming, IP=[%s], MMSC=[%s], dest_port=[%ld] ",
|
||||||
h.ip ? octstr_get_cstr(h.ip) : "",
|
h.ip ? octstr_get_cstr(h.ip) : "",
|
||||||
octstr_get_cstr(m->id));
|
octstr_get_cstr(m->id),
|
||||||
|
m->incoming.port);
|
||||||
|
|
||||||
/* Dump headers, url etc. */
|
/* Dump headers, url etc. */
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -469,7 +476,7 @@ void mmsc_receive_func(MmscGrp *m)
|
||||||
http_send_reply(h.client, HTTP_UNAUTHORIZED, hh,
|
http_send_reply(h.client, HTTP_UNAUTHORIZED, hh,
|
||||||
octstr_imm("Authentication failed"));
|
octstr_imm("Authentication failed"));
|
||||||
http_destroy_headers(hh);
|
http_destroy_headers(hh);
|
||||||
info(0, "MMSBox: Auth failed, incoming connection, MMC group=%s",
|
info(0, "MMSBox: Auth failed, incoming connection, MMC group=[%s]",
|
||||||
m->id ? octstr_get_cstr(m->id) : "(none)");
|
m->id ? octstr_get_cstr(m->id) : "(none)");
|
||||||
} else if (m->type == SOAP_MMSC)
|
} else if (m->type == SOAP_MMSC)
|
||||||
mm7soap_receive(&h);
|
mm7soap_receive(&h);
|
||||||
|
@ -499,7 +506,7 @@ static void free_clientInfo(MmsHTTPClientInfo *h, int freeh)
|
||||||
{
|
{
|
||||||
|
|
||||||
debug("free info", 0,
|
debug("free info", 0,
|
||||||
" entered free_clientinfo %d, ip=%ld", freeh, (long)h->ip);
|
" entered free_clientinfo %d, ip=[%ld]", freeh, (long)h->ip);
|
||||||
|
|
||||||
if (h->ip)
|
if (h->ip)
|
||||||
octstr_destroy(h->ip);
|
octstr_destroy(h->ip);
|
||||||
|
@ -575,7 +582,7 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
||||||
|
|
||||||
hstatus = mmsbox_url_fetch_content(HTTP_METHOD_POST, mmc->mmsc_url, rh, body, &ph,&rbody);
|
hstatus = mmsbox_url_fetch_content(HTTP_METHOD_POST, mmc->mmsc_url, rh, body, &ph,&rbody);
|
||||||
if (http_status_class(hstatus) != HTTP_STATUS_SUCCESSFUL) {
|
if (http_status_class(hstatus) != HTTP_STATUS_SUCCESSFUL) {
|
||||||
*error = octstr_format("Failed to contact MMC[url=%s] => HTTP returned status = %d!",
|
*error = octstr_format("Failed to contact MMC[url=%s] => HTTP returned status=[%d]!",
|
||||||
octstr_get_cstr(mmc->mmsc_url), hstatus);
|
octstr_get_cstr(mmc->mmsc_url), hstatus);
|
||||||
goto done1;
|
goto done1;
|
||||||
}
|
}
|
||||||
|
@ -602,7 +609,7 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
||||||
if (detail == NULL)
|
if (detail == NULL)
|
||||||
mm7_soap_header_value(mresp, octstr_imm("faultcode"));
|
mm7_soap_header_value(mresp, octstr_imm("faultcode"));
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
info(0, "Send to MMSC[%s], failed, code=[%d=>%s], detail=%s",
|
info(0, "Send to MMSC[%s], failed, code=[%d=>%s], detail=[%s]",
|
||||||
mmc ? octstr_get_cstr(mmc->id) : "",
|
mmc ? octstr_get_cstr(mmc->id) : "",
|
||||||
tstatus, mms_soap_status_to_cstr(tstatus),
|
tstatus, mms_soap_status_to_cstr(tstatus),
|
||||||
detail ? octstr_get_cstr(detail) : "");
|
detail ? octstr_get_cstr(detail) : "");
|
||||||
|
@ -618,7 +625,7 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
||||||
} else
|
} else
|
||||||
ret = mm7_soap_header_value(mresp, octstr_imm("MessageID"));
|
ret = mm7_soap_header_value(mresp, octstr_imm("MessageID"));
|
||||||
|
|
||||||
info(0, "Sent to MMC[%s], code=[%d=>%s], msgid [%s]", octstr_get_cstr(mmc->id),
|
info(0, "Sent to MMC[%s], code=[%d=>%s], msgid=[%s]", octstr_get_cstr(mmc->id),
|
||||||
tstatus, mms_soap_status_to_cstr(tstatus), ret ? octstr_get_cstr(ret) : "(none)");
|
tstatus, mms_soap_status_to_cstr(tstatus), ret ? octstr_get_cstr(ret) : "(none)");
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -153,6 +153,9 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
m->incoming.allow_ip = mms_cfg_get(x, octstr_imm("allow-ip"));
|
m->incoming.allow_ip = mms_cfg_get(x, octstr_imm("allow-ip"));
|
||||||
m->incoming.deny_ip = mms_cfg_get(x, octstr_imm("deny-ip"));
|
m->incoming.deny_ip = mms_cfg_get(x, octstr_imm("deny-ip"));
|
||||||
|
|
||||||
|
info(0, "MMSC[%s], allow=[%s], deny=[%s]", octstr_get_cstr(m->id),
|
||||||
|
octstr_get_cstr(m->incoming.allow_ip), octstr_get_cstr(m->incoming.deny_ip));
|
||||||
|
|
||||||
m->incoming.user = _mms_cfg_getx(x, octstr_imm("incoming-username"));
|
m->incoming.user = _mms_cfg_getx(x, octstr_imm("incoming-username"));
|
||||||
m->incoming.pass = _mms_cfg_getx(x, octstr_imm("incoming-password"));
|
m->incoming.pass = _mms_cfg_getx(x, octstr_imm("incoming-password"));
|
||||||
mms_cfg_get_int(x, octstr_imm("incoming-port"), &m->incoming.port);
|
mms_cfg_get_int(x, octstr_imm("incoming-port"), &m->incoming.port);
|
||||||
|
|
|
@ -539,7 +539,7 @@ static int mm7soap_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgId,
|
||||||
void *xx;
|
void *xx;
|
||||||
Octstr *s;
|
Octstr *s;
|
||||||
|
|
||||||
info(0, "MMS Relay: Send[soap] to VASP[%s], msg type [%s], from %s, to %s",
|
info(0, "MMS Relay: Send[soap] to VASP[%s], msg_type=[%s], from=[%s], to=[%s]",
|
||||||
vasp ? octstr_get_cstr(vasp->id) : "",
|
vasp ? octstr_get_cstr(vasp->id) : "",
|
||||||
mms_message_type_to_cstr(mtype), octstr_get_cstr(from), octstr_get_cstr(to));
|
mms_message_type_to_cstr(mtype), octstr_get_cstr(from), octstr_get_cstr(to));
|
||||||
|
|
||||||
|
@ -637,7 +637,7 @@ static int mm7eaif_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgid,
|
||||||
char *msgtype;
|
char *msgtype;
|
||||||
|
|
||||||
|
|
||||||
info(0, "MMS Relay: Send [eaif] to VASP[%s], msg type [%s], from %s, to %s",
|
info(0, "MMS Relay: Send [eaif] to VASP[%s], msg_type=[%s], from=[%s], to=[%s]",
|
||||||
vasp ? octstr_get_cstr(vasp->id) : "",
|
vasp ? octstr_get_cstr(vasp->id) : "",
|
||||||
mms_message_type_to_cstr(mtype), octstr_get_cstr(from), octstr_get_cstr(to));
|
mms_message_type_to_cstr(mtype), octstr_get_cstr(from), octstr_get_cstr(to));
|
||||||
|
|
||||||
|
|
|
@ -1600,7 +1600,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
||||||
if (mreq)
|
if (mreq)
|
||||||
msgtype = mms_mm7tag_to_cstr(mm7_msgtype(mreq));
|
msgtype = mms_mm7tag_to_cstr(mm7_msgtype(mreq));
|
||||||
debug("mmsprox.mm7sendinterface", 0,
|
debug("mmsprox.mm7sendinterface", 0,
|
||||||
" --> Enterred mm7dispatch interface, mreq=%s mtype = %s <-- ",
|
" --> Enterred mm7dispatch interface, mreq=[%s] mtype=[%s] <-- ",
|
||||||
mreq ? "Ok" : "Null",
|
mreq ? "Ok" : "Null",
|
||||||
mreq ? (char *)msgtype : "Null");
|
mreq ? (char *)msgtype : "Null");
|
||||||
|
|
||||||
|
@ -1756,7 +1756,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
||||||
http_close_client(h->client);
|
http_close_client(h->client);
|
||||||
|
|
||||||
debug("mmsprox.mm7sendinterface", 0,
|
debug("mmsprox.mm7sendinterface", 0,
|
||||||
" --> leaving mm7dispatch interface, mresp=%s, body=%s <-- ",
|
" --> leaving mm7dispatch interface, mresp=[%s], body=[%s] <-- ",
|
||||||
mresp ? "ok" : "(null)",
|
mresp ? "ok" : "(null)",
|
||||||
reply_body ? "ok" : "(null)");
|
reply_body ? "ok" : "(null)");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue