Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
b4081039
Commit
b4081039
authored
Oct 05, 2014
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conncheck: Computer STUN retransmission timeout (RTO) dynamically
This is how it is specified in RFC 5245 section 16
parent
fa21e01e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
agent/conncheck.c
agent/conncheck.c
+33
-3
No files found.
agent/conncheck.c
View file @
b4081039
...
...
@@ -1779,6 +1779,34 @@ size_t priv_get_password (NiceAgent *agent, Stream *stream,
return
0
;
}
/* Implement the computation specific in RFC 5245 section 16 */
static
unsigned
int
priv_compute_conncheck_timer
(
NiceAgent
*
agent
,
Stream
*
stream
)
{
GSList
*
item
;
guint
waiting_and_in_progress
=
0
;
unsigned
int
rto
=
0
;
for
(
item
=
stream
->
conncheck_list
;
item
;
item
=
item
->
next
)
{
CandidateCheckPair
*
pair
=
item
->
data
;
if
(
pair
->
state
==
NICE_CHECK_IN_PROGRESS
||
pair
->
state
==
NICE_CHECK_WAITING
)
waiting_and_in_progress
++
;
}
/* FIXME: This should also be multiple by "N", which I believe is the
* number of Streams currently in the conncheck state. */
rto
=
agent
->
timer_ta
*
waiting_and_in_progress
;
/* We assume non-reliable streams are RTP, so we use 100 as the max */
if
(
agent
->
reliable
)
return
MAX
(
rto
,
500
);
else
return
MAX
(
rto
,
100
);
}
/*
* Sends a connectivity check over candidate pair 'pair'.
*
...
...
@@ -1865,7 +1893,8 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
if
(
nice_socket_is_reliable
(
pair
->
sockptr
))
{
stun_timer_start_reliable
(
&
pair
->
timer
,
STUN_TIMER_DEFAULT_RELIABLE_TIMEOUT
);
}
else
{
stun_timer_start
(
&
pair
->
timer
,
STUN_TIMER_DEFAULT_TIMEOUT
,
stun_timer_start
(
&
pair
->
timer
,
priv_compute_conncheck_timer
(
agent
,
stream
),
STUN_TIMER_DEFAULT_MAX_RETRANSMISSIONS
);
}
...
...
@@ -2019,7 +2048,8 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream,
"restarting the timer again?: %s .."
,
agent
,
p
->
timer_restarted
?
"no"
:
"yes"
);
if
(
!
nice_socket_is_reliable
(
p
->
sockptr
)
&&
!
p
->
timer_restarted
)
{
stun_timer_start
(
&
p
->
timer
,
STUN_TIMER_DEFAULT_TIMEOUT
,
stun_timer_start
(
&
p
->
timer
,
priv_compute_conncheck_timer
(
agent
,
stream
),
STUN_TIMER_DEFAULT_MAX_RETRANSMISSIONS
);
p
->
timer_restarted
=
TRUE
;
}
...
...
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