Commit dd015d94 authored by Pekka Pessi's avatar Pekka Pessi

nua_stack.c: send nua_r_authenticate error events to the application.

darcs-hash:20061020173011-65a35-383b232379cd813637dd4fee9065d201364be130.gz
parent 6ffc4152
......@@ -260,7 +260,7 @@ int nua_stack_event(nua_t *nua, nua_handle_t *nh, msg_t *msg,
return event;
}
if ((event > nua_r_method && event <= nua_r_ack)
if ((event > nua_r_authenticate && event <= nua_r_ack)
|| (nh && !nh->nh_valid)
|| (nua->nua_shutdown && event != nua_r_shutdown)) {
if (msg)
......@@ -1605,21 +1605,26 @@ nua_stack_authenticate(nua_t *nua, nua_handle_t *nh, nua_event_t e,
nua_client_request_t *cr;
nua_creq_restart_f *restart = NULL;
nua_stack_event(nua, nh, NULL, e, SIP_200_OK, TAG_END());
cr = nua_client_request_restarting(nh->nh_cr);
if (cr)
restart = cr->cr_restart, cr->cr_restart = NULL;
if (restart)
if (restart) {
/* nua_stack_event(nua, nh, NULL, e, SIP_200_OK, TAG_END()); */
restart(nh, (tagi_t *)tags); /* Restart operation */
}
else {
nua_stack_event(nua, nh, NULL, e,
202, "No operation to restart",
TAG_END());
}
}
else if (status < 0) {
nua_stack_event(nua, nh, NULL, e, 500, "Cannot add credentials", TAG_END());
nua_stack_event(nua, nh, NULL, e, 900, "Cannot add credentials", TAG_END());
}
else {
nua_stack_event(nua, nh, NULL, e, 404, "No matching challenge", TAG_END());
nua_stack_event(nua, nh, NULL, e, 904, "No matching challenge", TAG_END());
}
}
......
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