Commit f26df968 authored by Pekka Pessi's avatar Pekka Pessi

nua: fix logging crash if outbound used with application contact

Silenced warnings.

darcs-hash:20071010171640-65a35-17a5edd3cb78d1485fdb34e6237a0d62e5e59f26.gz
parent 22318d37
......@@ -309,7 +309,8 @@ nua_stack_signal_handler
nua_stack_set_params, nua_stack_get_params,
nua_stack_register,
nua_stack_invite, nua_stack_ack, nua_stack_cancel,
nua_stack_bye, nua_stack_info, nua_stack_update,
nua_stack_bye, nua_stack_info, nua_stack_update,
nua_stack_prack,
nua_stack_options, nua_stack_publish, nua_stack_message,
nua_stack_subscribe, nua_stack_notify, nua_stack_refer,
nua_stack_method;
......
......@@ -863,11 +863,20 @@ static int response_to_keepalive_options(outbound_t *ob,
loglevel = 1; /* XXX ... for now */
if (loglevel >= SU_LOG->log_level) {
su_llog(SU_LOG, loglevel,
"outbound(%p): %s <" URL_PRINT_FORMAT ">\n",
(void *)ob->ob_owner,
failed ? "FAILED to validate" : "validated",
URL_PRINT_ARGS(ob->ob_rcontact->m_url));
sip_contact_t const *m = ob->ob_rcontact;
if (m)
su_llog(SU_LOG, loglevel,
"outbound(%p): %s <" URL_PRINT_FORMAT ">\n",
(void *)ob->ob_owner,
failed ? "FAILED to validate" : "validated",
URL_PRINT_ARGS(m->m_url));
else
su_llog(SU_LOG, loglevel,
"outbound(%p): %s registration\n",
(void *)ob->ob_owner,
failed ? "FAILED to validate" : "validated");
if (failed)
su_llog(SU_LOG, loglevel, "outbound(%p): FAILED with %u %s\n",
(void *)ob->ob_owner, status, phrase);
......@@ -1101,6 +1110,8 @@ int outbound_set_contact(outbound_t *ob,
previous = ob->ob_rcontact;
}
else if (application_contact) {
rcontact = sip_contact_dup(home, application_contact);
if (!ob->ob_rcontact ||
url_cmp_all(ob->ob_rcontact->m_url, application_contact->m_url)) {
contact_uri_changed = 1;
......
......@@ -72,9 +72,9 @@ int test_nua_api_errors(struct context *ctx)
TEST(status, 200); TEST_S(phrase, sip_200_OK);
su_log_init(nua_log);
level = nua_log->log_level;
if (!(tstflags & tst_verbatim))
su_log_set_level(nua_log, 0); /* Log at level 0 by default */
level = nua_log->log_level;
TEST_1(!nua_create(NULL, NULL, NULL, TAG_END()));
TEST_VOID(nua_shutdown(NULL));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment