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
0407fbbd
Commit
0407fbbd
authored
Jun 08, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep in progress checks running if their priority is higher than the nominated pair...
parent
376dedd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
11 deletions
+42
-11
agent/conncheck.c
agent/conncheck.c
+42
-11
No files found.
agent/conncheck.c
View file @
0407fbbd
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
static
void
priv_update_check_list_failed_components
(
NiceAgent
*
agent
,
Stream
*
stream
);
static
void
priv_update_check_list_failed_components
(
NiceAgent
*
agent
,
Stream
*
stream
);
static
void
priv_update_check_list_state_for_ready
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
);
static
void
priv_update_check_list_state_for_ready
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
);
static
void
priv_prune_pending_checks
(
Stream
*
stream
,
guint
component_id
);
static
guint
priv_prune_pending_checks
(
Stream
*
stream
,
guint
component_id
);
static
gboolean
priv_schedule_triggered_check
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
,
NiceSocket
*
local_socket
,
NiceCandidate
*
remote_cand
,
gboolean
use_candidate
);
static
gboolean
priv_schedule_triggered_check
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
,
NiceSocket
*
local_socket
,
NiceCandidate
*
remote_cand
,
gboolean
use_candidate
);
static
void
priv_mark_pair_nominated
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
,
NiceCandidate
*
remotecand
);
static
void
priv_mark_pair_nominated
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
,
NiceCandidate
*
remotecand
);
static
size_t
priv_create_username
(
NiceAgent
*
agent
,
Stream
*
stream
,
static
size_t
priv_create_username
(
NiceAgent
*
agent
,
Stream
*
stream
,
...
@@ -1074,11 +1074,13 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *st
...
@@ -1074,11 +1074,13 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *st
++
succeeded
;
++
succeeded
;
if
(
p
->
nominated
==
TRUE
)
{
if
(
p
->
nominated
==
TRUE
)
{
++
nominated
;
++
nominated
;
priv_prune_pending_checks
(
stream
,
p
->
component_id
);
/* Only go to READY if no checks are left in progress. If there are
agent_signal_component_state_change
(
agent
,
* any that are kept, then this function will be called again when the
p
->
stream_id
,
* conncheck tick timer finishes them all */
p
->
component_id
,
if
(
priv_prune_pending_checks
(
stream
,
p
->
component_id
)
==
0
)
{
NICE_COMPONENT_STATE_READY
);
agent_signal_component_state_change
(
agent
,
p
->
stream_id
,
p
->
component_id
,
NICE_COMPONENT_STATE_READY
);
}
}
}
}
}
}
}
...
@@ -1571,9 +1573,26 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1571,9 +1573,26 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
*
*
* @see priv_update_check_list_state_failed_components()
* @see priv_update_check_list_state_failed_components()
*/
*/
static
void
priv_prune_pending_checks
(
Stream
*
stream
,
guint
component_id
)
static
guint
priv_prune_pending_checks
(
Stream
*
stream
,
guint
component_id
)
{
{
GSList
*
i
;
GSList
*
i
;
guint64
highest_nominated_priority
=
0
;
guint
in_progress
=
0
;
for
(
i
=
stream
->
conncheck_list
;
i
;
i
=
i
->
next
)
{
CandidateCheckPair
*
p
=
i
->
data
;
if
(
p
->
component_id
==
component_id
&&
(
p
->
state
==
NICE_CHECK_SUCCEEDED
||
p
->
state
==
NICE_CHECK_DISCOVERED
)
&&
p
->
nominated
==
TRUE
){
if
(
p
->
priority
>
highest_nominated_priority
)
{
highest_nominated_priority
=
p
->
priority
;
}
}
}
nice_debug
(
"Agent XXX: Pruning pending checks. Highest nominated priority "
"is %lu"
,
highest_nominated_priority
);
/* step: cancel all FROZEN and WAITING pairs for the component */
/* step: cancel all FROZEN and WAITING pairs for the component */
for
(
i
=
stream
->
conncheck_list
;
i
;
i
=
i
->
next
)
{
for
(
i
=
stream
->
conncheck_list
;
i
;
i
=
i
->
next
)
{
...
@@ -1587,13 +1606,25 @@ static void priv_prune_pending_checks (Stream *stream, guint component_id)
...
@@ -1587,13 +1606,25 @@ static void priv_prune_pending_checks (Stream *stream, guint component_id)
/* note: a SHOULD level req. in ICE 8.1.2. "Updating States" (ID-19) */
/* note: a SHOULD level req. in ICE 8.1.2. "Updating States" (ID-19) */
if
(
p
->
state
==
NICE_CHECK_IN_PROGRESS
)
{
if
(
p
->
state
==
NICE_CHECK_IN_PROGRESS
)
{
if
(
highest_nominated_priority
!=
0
&&
p
->
priority
<
highest_nominated_priority
)
{
p
->
stun_message
.
buffer
=
NULL
;
p
->
stun_message
.
buffer
=
NULL
;
p
->
stun_message
.
buffer_len
=
0
;
p
->
stun_message
.
buffer_len
=
0
;
p
->
state
=
NICE_CHECK_CANCELLED
;
p
->
state
=
NICE_CHECK_CANCELLED
;
nice_debug
(
"Agent XXX : pair %p state CANCELED"
,
p
);
nice_debug
(
"Agent XXX : pair %p state CANCELED"
,
p
);
}
else
{
/* We must keep the higher priority pairs running because if a udp
* packet was lost, we might end up using a bad candidate */
nice_debug
(
"Agent XXX : pair %p kept IN_PROGRESS because priority %d"
" is higher than currently nominated pair %d"
,
p
,
p
->
priority
,
highest_nominated_priority
);
in_progress
++
;
}
}
}
}
}
}
}
return
in_progress
;
}
}
/*
/*
...
...
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