Commit bb4bb82e authored by Pekka Pessi's avatar Pekka Pessi

nua_subnotref.c: nua_unsubscribe() should not terminate usage w/ final response

Do not terminate until final NOTIFY or timeout.

darcs-hash:20080806191730-db55f-1cd547ef00becb81cde3cd82fb1cca3585a38f9e.gz
parent 2b1f7087
......@@ -249,7 +249,7 @@ static int nua_subscribe_client_request(nua_client_request_t *cr,
nua_dialog_usage_t *du = cr->cr_usage;
sip_time_t expires = 0;
if (cr->cr_event != nua_r_subscribe || !du || du->du_shutdown)
if (cr->cr_event == nua_r_destroy || !du || du->du_shutdown)
cr->cr_terminating = 1;
if (du) {
......@@ -281,7 +281,7 @@ static int nua_subscribe_client_request(nua_client_request_t *cr,
nua_dialog_usage_reset_refresh(du); /* during SUBSCRIBE transaction */
if (cr->cr_terminating)
if (cr->cr_terminating || cr->cr_event != nua_r_subscribe)
expires = eu->eu_delta = 0;
else if (sip->sip_expires)
/* Use value specified by application or negotiated with Min-Expires */
......
......@@ -954,7 +954,10 @@ int test_subscribe_notify(struct context *ctx)
TEST(e->data->e_status, 200);
r_tags = e->data->e_tags;
TEST_1(tl_find(r_tags, nutag_substate));
TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_terminated);
if (en1 == a->events->head)
TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_terminated);
else
TEST(tl_find(r_tags, nutag_substate)->t_value, nua_substate_active);
TEST_1(sip = sip_object(e->data->e_msg));
TEST_1(sip->sip_expires);
TEST_1(sip->sip_expires->ex_delta == 0);
......
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