Commit 9f61a8af authored by Pekka Pessi's avatar Pekka Pessi

nua: renamed crm_deinit as crm_complete, commented nua_client_methods_t initializers

darcs-hash:20080225171031-65a35-18de5b5013d2ba41ec87edea28110122300d4939.gz
parent 72424b26
......@@ -253,11 +253,11 @@ typedef struct {
nta_outgoing_t *orq,
tagi_t const *tags);
/** @a crm_deinit is called when a client-side request is destroyed.
/** @a crm_complete is called when a client-side request is destroyed.
*
* @return The return value should be 0. It is currently ignored.
*/
int (*crm_deinit)(nua_client_request_t *);
int (*crm_complete)(nua_client_request_t *);
} nua_client_methods_t;
......@@ -516,6 +516,8 @@ void *nua_private_client_request(nua_client_request_t const *cr)
return (void *)(cr + 1);
}
void nua_client_request_complete(nua_client_request_t *);
void nua_client_request_destroy(nua_client_request_t *);
int nua_client_request_queue(nua_client_request_t *cr);
......
......@@ -74,18 +74,21 @@
*/
static nua_client_methods_t const nua_method_client_methods = {
SIP_METHOD_UNKNOWN,
0,
{
SIP_METHOD_UNKNOWN, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 0,
/* target_refresh */ 1,
},
/* nua_method_client_template */ NULL,
/* nua_method_client_init */ NULL,
/* nua_method_client_request */ NULL,
/* nua_method_client_check_restart */ NULL,
/* nua_method_client_response */ NULL
NULL, /* crm_template */
NULL, /* crm_init */
NULL, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int
......
......@@ -77,18 +77,22 @@ static int nua_message_client_init(nua_client_request_t *cr,
tagi_t const *tags);
static nua_client_methods_t const nua_message_client_methods = {
SIP_METHOD_MESSAGE,
0,
{
SIP_METHOD_MESSAGE, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 0,
/* target refresh */ 0
},
/* nua_message_client_template */ NULL,
nua_message_client_init,
/*nua_message_client_request*/ NULL,
/* nua_message_client_check_restart */ NULL,
/*nua_message_client_response*/ NULL
NULL, /* crm_template */
nua_message_client_init, /* crm_init */
NULL, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int
......
......@@ -420,20 +420,21 @@ static int nua_notify_client_report(nua_client_request_t *cr,
tagi_t const *tags);
static nua_client_methods_t const nua_notify_client_methods = {
SIP_METHOD_NOTIFY,
0,
{
SIP_METHOD_NOTIFY, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 1,
/* in_dialog */ 1,
/* target refresh */ 1
},
/* nua_notify_client_template */ NULL,
nua_notify_client_init,
nua_notify_client_request,
/* nua_notify_client_check_restart */ NULL,
/* nua_notify_client_response */ NULL,
/* nua_notify_client_preliminary */ NULL,
nua_notify_client_report
NULL, /* crm_template */
nua_notify_client_init, /* crm_init */
nua_notify_client_request, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
nua_notify_client_report, /* crm_report */
NULL, /* crm_complete */
};
/**@internal Send NOTIFY. */
......
......@@ -88,18 +88,21 @@
*/
static nua_client_methods_t const nua_options_client_methods = {
SIP_METHOD_OPTIONS,
0,
{
SIP_METHOD_OPTIONS, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 0,
/* target refresh */ 0
},
/*nua_options_client_template*/ NULL,
/*nua_options_client_init*/ NULL,
/*nua_options_client_request*/ NULL,
/* nua_options_client_check_restart */ NULL,
/*nua_options_client_response*/ NULL
NULL, /* crm_template */
NULL, /* crm_init */
NULL, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int nua_stack_options(nua_t *nua,
......
......@@ -244,19 +244,21 @@ static int nua_publish_client_response(nua_client_request_t *cr,
sip_t const *sip);
static nua_client_methods_t const nua_publish_client_methods = {
SIP_METHOD_PUBLISH,
0,
{
SIP_METHOD_PUBLISH, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 0,
/* target refresh */ 0
},
nua_publish_client_template,
nua_publish_client_init,
nua_publish_client_request,
nua_publish_client_check_restart,
nua_publish_client_response,
/* nua_publish_client_preliminary */ NULL
nua_publish_client_template, /* crm_template */
nua_publish_client_init, /* crm_init */
nua_publish_client_request, /* crm_send */
nua_publish_client_check_restart, /* crm_check_restart */
nua_publish_client_response, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
/**@internal Send PUBLISH. */
......
......@@ -570,18 +570,21 @@ static int nua_register_client_response(nua_client_request_t *cr,
sip_t const *sip);
static nua_client_methods_t const nua_register_client_methods = {
SIP_METHOD_REGISTER,
0,
{
SIP_METHOD_REGISTER, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 1,
/* in_dialog */ 0,
/* target refresh */ 0
},
nua_register_client_template,
nua_register_client_init,
nua_register_client_request,
nua_register_client_check_restart,
nua_register_client_response
nua_register_client_template, /* crm_template */
nua_register_client_init, /* crm_init */
nua_register_client_request, /* crm_send */
nua_register_client_check_restart, /* crm_check_restart */
nua_register_client_response, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
/**@internal Send REGISTER. */
......
......@@ -191,7 +191,7 @@ static int nua_session_usage_shutdown(nua_owner_t *,
nua_dialog_usage_t *);
static int nua_invite_client_ack(nua_client_request_t *cr, tagi_t const *tags);
static int nua_invite_client_deinit(nua_client_request_t *cr);
static int nua_invite_client_complete(nua_client_request_t *cr);
static nua_usage_class const nua_session_usage[1] = {
{
......@@ -542,21 +542,21 @@ static int nua_invite_client_report(nua_client_request_t *cr,
tagi_t const *tags);
nua_client_methods_t const nua_invite_client_methods = {
SIP_METHOD_INVITE,
0,
{
SIP_METHOD_INVITE, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 1,
/* in_dialog */ 1,
/* target refresh */ 1
},
NULL,
nua_invite_client_init,
nua_invite_client_request,
session_timer_check_restart,
nua_invite_client_response,
nua_invite_client_preliminary,
nua_invite_client_report,
nua_invite_client_deinit
NULL, /* crm_template */
nua_invite_client_init, /* crm_init */
nua_invite_client_request, /* crm_send */
session_timer_check_restart, /* crm_check_restart */
nua_invite_client_response, /* crm_recv */
nua_invite_client_preliminary, /* crm_preliminary */
nua_invite_client_report, /* crm_report */
nua_invite_client_complete, /* crm_complete */
};
extern nua_client_methods_t const nua_bye_client_methods;
......@@ -1225,8 +1225,8 @@ int nua_invite_client_ack(nua_client_request_t *cr, tagi_t const *tags)
return error;
}
/** Deinitialize client request */
static int nua_invite_client_deinit(nua_client_request_t *cr)
/** Complete client request */
static int nua_invite_client_complete(nua_client_request_t *cr)
{
if (cr->cr_orq == NULL)
/* Xyzzy */;
......@@ -1262,18 +1262,21 @@ static int nua_cancel_client_request(nua_client_request_t *cr,
tagi_t const *tags);
nua_client_methods_t const nua_cancel_client_methods = {
SIP_METHOD_CANCEL,
0,
{
SIP_METHOD_CANCEL, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 1,
/* target refresh */ 0
},
NULL,
NULL,
nua_cancel_client_request,
/* nua_cancel_client_check_restart */ NULL,
/* nua_cancel_client_response */ NULL
NULL, /* crm_template */
NULL, /* crm_init */
nua_cancel_client_request, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int nua_stack_cancel(nua_t *nua, nua_handle_t *nh, nua_event_t e,
......@@ -1492,20 +1495,21 @@ static int nua_prack_client_report(nua_client_request_t *cr,
tagi_t const *tags);
nua_client_methods_t const nua_prack_client_methods = {
SIP_METHOD_PRACK,
0,
{
SIP_METHOD_PRACK, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 1,
/* target refresh */ 0
},
NULL,
nua_prack_client_init,
nua_prack_client_request,
/* nua_prack_client_check_restart */ NULL,
nua_prack_client_response,
NULL,
nua_prack_client_report
NULL, /* crm_template */
nua_prack_client_init, /* crm_init */
nua_prack_client_request, /* crm_send */
NULL, /* crm_check_restart */
nua_prack_client_response, /* crm_recv */
NULL, /* crm_preliminary */
nua_prack_client_report, /* crm_report */
NULL, /* crm_complete */
};
int nua_stack_prack(nua_t *nua, nua_handle_t *nh, nua_event_t e,
......@@ -2786,18 +2790,21 @@ static int nua_info_client_request(nua_client_request_t *cr,
tagi_t const *tags);
nua_client_methods_t const nua_info_client_methods = {
SIP_METHOD_INFO,
0,
{
SIP_METHOD_INFO, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 1,
/* target refresh */ 0
},
/*nua_info_client_template*/ NULL,
nua_info_client_init,
nua_info_client_request,
/*nua_info_client_check_restart*/ NULL,
/*nua_info_client_response*/ NULL
NULL, /* crm_template */
nua_info_client_init, /* crm_init */
nua_info_client_request, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int
......@@ -2933,20 +2940,21 @@ static int nua_update_client_report(nua_client_request_t *cr,
tagi_t const *tags);
nua_client_methods_t const nua_update_client_methods = {
SIP_METHOD_UPDATE,
0, /* size of private data */
{
SIP_METHOD_UPDATE, /* crm_method, crm_method_name */
0, /* crm_extrasize of private data */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 1,
/* target refresh */ 1
},
NULL,
nua_update_client_init,
nua_update_client_request,
session_timer_check_restart,
nua_update_client_response,
NULL,
nua_update_client_report
NULL, /* crm_template */
nua_update_client_init, /* crm_init */
nua_update_client_request, /* crm_send */
session_timer_check_restart, /* crm_check_restart */
nua_update_client_response, /* crm_recv */
NULL, /* crm_preliminary */
nua_update_client_report, /* crm_report */
NULL, /* crm_complete */
};
int nua_stack_update(nua_t *nua, nua_handle_t *nh, nua_event_t e,
......@@ -3396,20 +3404,21 @@ static int nua_bye_client_report(nua_client_request_t *cr,
tagi_t const *tags);
nua_client_methods_t const nua_bye_client_methods = {
SIP_METHOD_BYE,
0,
{
SIP_METHOD_BYE, /* crm_method, crm_method_name */
0, /* crm_extrasize */
{ /* crm_flags */
/* create_dialog */ 0,
/* in_dialog */ 1,
/* target refresh */ 0
},
NULL,
nua_bye_client_init,
nua_bye_client_request,
/*nua_bye_client_check_restart*/ NULL,
/*nua_bye_client_response*/ NULL,
/*nua_bye_client_preliminary*/ NULL,
nua_bye_client_report
NULL, /* crm_template */
nua_bye_client_init, /* crm_init */
nua_bye_client_request, /* crm_send */
NULL, /* crm_check_restart */
NULL, /* crm_recv */
NULL, /* crm_preliminary */
nua_bye_client_report, /* crm_report */
NULL, /* crm_complete */
};
int
......
......@@ -2076,6 +2076,12 @@ nua_client_request_t *nua_client_request_remove(nua_client_request_t *cr)
return cr;
}
void nua_client_request_complete(nua_client_request_t *cr)
{
if (cr && cr->cr_methods->crm_complete)
cr->cr_methods->crm_complete(cr);
}
void nua_client_request_destroy(nua_client_request_t *cr)
{
nua_handle_t *nh;
......@@ -2083,8 +2089,7 @@ void nua_client_request_destroy(nua_client_request_t *cr)
if (cr == NULL)
return;
if (cr->cr_methods->crm_deinit)
cr->cr_methods->crm_deinit(cr);
nua_client_request_complete(cr);
nh = cr->cr_owner;
......
......@@ -183,18 +183,21 @@ static int nua_subscribe_client_response(nua_client_request_t *cr,
sip_t const *sip);
static nua_client_methods_t const nua_subscribe_client_methods = {
SIP_METHOD_SUBSCRIBE,
0,
{
SIP_METHOD_SUBSCRIBE, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 1,
/* in_dialog */ 1,
/* target refresh */ 1
},
NULL,
nua_subscribe_client_init,
nua_subscribe_client_request,
/* nua_subscribe_client_check_restart */ NULL,
nua_subscribe_client_response
NULL, /* crm_template */
nua_subscribe_client_init, /* crm_init */
nua_subscribe_client_request, /* crm_send */
NULL, /* crm_check_restart */
nua_subscribe_client_response, /* crm_recv */
NULL, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int
......@@ -779,20 +782,21 @@ static int nua_refer_client_response(nua_client_request_t *cr,
sip_t const *sip);
static nua_client_methods_t const nua_refer_client_methods = {
SIP_METHOD_REFER,
0,
{
SIP_METHOD_REFER, /* crm_method, crm_method_name */
0, /* crm_extra */
{ /* crm_flags */
/* create_dialog */ 1,
/* in_dialog */ 1,
/* target refresh */ 1
},
/*nua_refer_client_template*/ NULL,
nua_refer_client_init,
nua_refer_client_request,
/* nua_refer_client_check_restart */ NULL,
nua_refer_client_response,
nua_refer_client_response, /* Preliminary */
NULL
NULL, /* crm_template */
nua_refer_client_init, /* crm_init */
nua_refer_client_request, /* crm_send */
NULL, /* crm_check_restart */
nua_refer_client_response, /* crm_recv */
nua_refer_client_response, /* crm_preliminary */
NULL, /* crm_report */
NULL, /* crm_complete */
};
int
......
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