Commit c4c982c5 authored by Kai Vehmanen's avatar Kai Vehmanen

nua: Make registration transport connections persistant.

darcs-hash:20070202151504-77cd4-d32f8f780a3b0fcb4c7df89d22d19213ba27f96b.gz
parent 01711f4f
......@@ -27,6 +27,7 @@
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Martti Mela <Martti.Mela@nokia.com>
* @author Kai Vehmanen <Kai.Vehmanen@nokia.com>
*
* @date Created: Wed Mar 8 11:48:49 EET 2006 ppessi
*/
......@@ -902,6 +903,11 @@ static int nua_register_client_response(nua_client_request_t *cr,
outbound_start_keepalive(nr->nr_ob, cr->cr_orq);
}
/* persistant connection for registration */
if (!nr->nr_tport)
/* note: nta_outgoing_transport() takes a ref */
nr->nr_tport = nta_outgoing_transport (cr->cr_orq);
nua_registration_set_ready(nr, 1);
}
else if (du) {
......@@ -912,6 +918,10 @@ static int nua_register_client_response(nua_client_request_t *cr,
outbound_stop_keepalive(nr->nr_ob);
/* release the persistant transport for registration */
if (nr->nr_tport)
tport_decref(&nr->nr_tport), nr->nr_tport = NULL;
nua_registration_set_ready(nr, 0);
}
......@@ -949,6 +959,7 @@ static int nua_register_usage_shutdown(nua_handle_t *nh,
nua_dialog_usage_t *du)
{
nua_client_request_t *cr = du->du_cr;
nua_registration_t *nr = nua_dialog_usage_private(du);
if (cr) {
if (nua_client_is_queued(cr)) /* Already registering. */
......@@ -958,6 +969,10 @@ static int nua_register_usage_shutdown(nua_handle_t *nh,
return 0;
}
/* release the persistant transport for registration */
if (nr->nr_tport)
tport_decref(&nr->nr_tport), nr->nr_tport = NULL;
nua_dialog_usage_remove(nh, ds, du);
return 200;
}
......
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