Commit 790cc203 authored by Pekka Pessi's avatar Pekka Pessi

nua_stack.c: update the status returned to the client if there is an error...

nua_stack.c: update the status returned to the client if there is an error while responding to a request.

The problem was reported by Michael Jerris and Joshua Engelbrecht.

darcs-hash:20070412150916-65a35-11224eb7b9e80765716b5c15a8467e8d5158f19c.gz
parent 5a632e6a
......@@ -1511,9 +1511,26 @@ int nua_server_respond(nua_server_request_t *sr, tagi_t const *tags)
int nua_base_server_respond(nua_server_request_t *sr, tagi_t const *tags)
{
msg_t *response = sr->sr_response.msg;
sip_t *sip = sr->sr_response.sip;
sr->sr_response.msg = NULL, sr->sr_response.sip = NULL;
if (sr->sr_status != sip->sip_status->st_status) {
msg_header_remove(response, (msg_pub_t *)sip,
(msg_header_t *)sip->sip_status);
nta_incoming_complete_response(sr->sr_irq, response,
sr->sr_status,
sr->sr_phrase,
TAG_END());
}
if (sr->sr_status != sip->sip_status->st_status) {
msg_destroy(response);
SR_STATUS1(sr, SIP_500_INTERNAL_SERVER_ERROR);
nta_incoming_treply(sr->sr_irq, sr->sr_status, sr->sr_phrase, TAG_END());
return 0;
}
return nta_incoming_mreply(sr->sr_irq, response);
}
......
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