1
0
Fork 0

Misc. error format cleanups

This commit is contained in:
bagyenda 2007-03-27 10:23:47 +00:00
parent 5af2e53f30
commit eb1a689a8a
5 changed files with 25 additions and 15 deletions

View File

@ -598,7 +598,7 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
return val;
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);
return -1;
}

View File

@ -124,7 +124,7 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
MSoapMsg_t *mreq = NULL, *mresp = NULL;
int hstatus = HTTP_OK;
List *rh = NULL;
Octstr *reply_body = NULL, *value;
Octstr *reply_body = NULL, *value, *desc;
List *to = NULL;
Octstr *from = NULL, *subject = NULL, *vasid = NULL, *msgid = NULL;
@ -197,11 +197,17 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
break;
case MM7_TAG_DeliveryReportReq:
desc = mm7_soap_header_value(mreq, octstr_imm("StatusText"));
msgid = mm7_soap_header_value(mreq, octstr_imm("MessageID"));
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);
if (desc)
octstr_destroy(desc);
if (value)
octstr_destroy(value);
mms_log("DeliveryReport",
@ -235,7 +241,7 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
http_close_client(h->client);
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)",
reply_body ? "ok" : "(null)", status);
@ -287,7 +293,7 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
int mtype;
debug("mmsbox.mm7eaif.sendinterface", 0,
" --> Enterred eaif send interface, blen=%d <--- ",
" --> Enterred eaif send interface, blen=[%d] <--- ",
msize);
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"));
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) : "",
octstr_get_cstr(m->id));
octstr_get_cstr(m->id),
m->incoming.port);
/* Dump headers, url etc. */
#if 1
@ -469,7 +476,7 @@ void mmsc_receive_func(MmscGrp *m)
http_send_reply(h.client, HTTP_UNAUTHORIZED, hh,
octstr_imm("Authentication failed"));
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)");
} else if (m->type == SOAP_MMSC)
mm7soap_receive(&h);
@ -499,7 +506,7 @@ static void free_clientInfo(MmsHTTPClientInfo *h, int freeh)
{
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)
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);
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);
goto done1;
}
@ -602,7 +609,7 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
if (detail == NULL)
mm7_soap_header_value(mresp, octstr_imm("faultcode"));
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) : "",
tstatus, mms_soap_status_to_cstr(tstatus),
detail ? octstr_get_cstr(detail) : "");
@ -618,7 +625,7 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
} else
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)");
if (ret)

View File

@ -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.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.pass = _mms_cfg_getx(x, octstr_imm("incoming-password"));
mms_cfg_get_int(x, octstr_imm("incoming-port"), &m->incoming.port);

View File

@ -539,7 +539,7 @@ static int mm7soap_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgId,
void *xx;
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) : "",
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;
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) : "",
mms_message_type_to_cstr(mtype), octstr_get_cstr(from), octstr_get_cstr(to));

View File

@ -1600,7 +1600,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
if (mreq)
msgtype = mms_mm7tag_to_cstr(mm7_msgtype(mreq));
debug("mmsprox.mm7sendinterface", 0,
" --> Enterred mm7dispatch interface, mreq=%s mtype = %s <-- ",
" --> Enterred mm7dispatch interface, mreq=[%s] mtype=[%s] <-- ",
mreq ? "Ok" : "Null",
mreq ? (char *)msgtype : "Null");
@ -1756,7 +1756,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
http_close_client(h->client);
debug("mmsprox.mm7sendinterface", 0,
" --> leaving mm7dispatch interface, mresp=%s, body=%s <-- ",
" --> leaving mm7dispatch interface, mresp=[%s], body=[%s] <-- ",
mresp ? "ok" : "(null)",
reply_body ? "ok" : "(null)");