Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
38aede18
Commit
38aede18
authored
Apr 04, 2014
by
jehan
Browse files
improve refresher behvior when pending transaction need to be canceled
parent
e881f051
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/refresher.c
View file @
38aede18
...
...
@@ -427,6 +427,17 @@ static int belle_sip_refresher_refresh_internal(belle_sip_refresher_t* refresher
client_transaction
=
belle_sip_provider_create_client_transaction
(
prov
,
request
);
client_transaction
->
base
.
is_internal
=
1
;
belle_sip_transaction_set_application_data
(
BELLE_SIP_TRANSACTION
(
client_transaction
),
refresher
);
switch
(
belle_sip_transaction_get_state
(
BELLE_SIP_TRANSACTION
(
refresher
->
transaction
)))
{
case
BELLE_SIP_TRANSACTION_INIT
:
case
BELLE_SIP_TRANSACTION_CALLING
:
case
BELLE_SIP_TRANSACTION_TRYING
:
/*very early state, we can assume nobody will answer, stop retransmiting*/
belle_sip_transaction_terminate
(
BELLE_SIP_TRANSACTION
(
refresher
->
transaction
));
break
;
default:
/*we preserve the transaction "as is"*/
break
;
}
/*update reference transaction for next refresh*/
belle_sip_object_unref
(
refresher
->
transaction
);
refresher
->
transaction
=
client_transaction
;
...
...
@@ -591,6 +602,9 @@ void belle_sip_refresher_stop(belle_sip_refresher_t* refresher) {
belle_sip_object_unref
(
refresher
->
timer
);
refresher
->
timer
=
NULL
;
}
if
(
refresher
->
transaction
&&
belle_sip_transaction_state_is_transient
(
belle_sip_transaction_get_state
(
BELLE_SIP_TRANSACTION
(
refresher
->
transaction
))))
{
belle_sip_transaction_terminate
(
BELLE_SIP_TRANSACTION
(
refresher
->
transaction
));
/*refresher cancelled, no need to continue to retransmit*/
}
refresher
->
state
=
stopped
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment