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
67392282
Commit
67392282
authored
Sep 23, 2014
by
Philip Withnall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: Add some preconditions to internal API
To try and avoid NULL NiceCandidates entering our internal state.
parent
778c99c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
agent/component.c
agent/component.c
+2
-0
agent/conncheck.c
agent/conncheck.c
+17
-2
agent/discovery.c
agent/discovery.c
+2
-0
No files found.
agent/component.c
View file @
67392282
...
@@ -447,6 +447,8 @@ component_set_selected_remote_candidate (NiceAgent *agent, Component *component,
...
@@ -447,6 +447,8 @@ component_set_selected_remote_candidate (NiceAgent *agent, Component *component,
guint64
priority
=
0
;
guint64
priority
=
0
;
GSList
*
item
=
NULL
;
GSList
*
item
=
NULL
;
g_assert
(
candidate
!=
NULL
);
for
(
item
=
component
->
local_candidates
;
item
;
item
=
g_slist_next
(
item
))
{
for
(
item
=
component
->
local_candidates
;
item
;
item
=
g_slist_next
(
item
))
{
NiceCandidate
*
tmp
=
item
->
data
;
NiceCandidate
*
tmp
=
item
->
data
;
guint64
tmp_prio
=
0
;
guint64
tmp_prio
=
0
;
...
...
agent/conncheck.c
View file @
67392282
...
@@ -1341,8 +1341,14 @@ static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Componen
...
@@ -1341,8 +1341,14 @@ static void priv_mark_pair_nominated (NiceAgent *agent, Stream *stream, Componen
*/
*/
static
void
priv_add_new_check_pair
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
,
NiceCheckState
initial_state
,
gboolean
use_candidate
)
static
void
priv_add_new_check_pair
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
,
NiceCheckState
initial_state
,
gboolean
use_candidate
)
{
{
Stream
*
stream
=
agent_find_stream
(
agent
,
stream_id
);
Stream
*
stream
;
CandidateCheckPair
*
pair
=
g_slice_new0
(
CandidateCheckPair
);
CandidateCheckPair
*
pair
;
g_assert
(
local
!=
NULL
);
g_assert
(
remote
!=
NULL
);
stream
=
agent_find_stream
(
agent
,
stream_id
);
pair
=
g_slice_new0
(
CandidateCheckPair
);
stream
->
conncheck_list
=
g_slist_insert_sorted
(
stream
->
conncheck_list
,
pair
,
stream
->
conncheck_list
=
g_slist_insert_sorted
(
stream
->
conncheck_list
,
pair
,
(
GCompareFunc
)
conn_check_compare
);
(
GCompareFunc
)
conn_check_compare
);
...
@@ -1420,6 +1426,9 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent,
...
@@ -1420,6 +1426,9 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent,
{
{
gboolean
ret
=
FALSE
;
gboolean
ret
=
FALSE
;
g_assert
(
local
!=
NULL
);
g_assert
(
remote
!=
NULL
);
/* note: do not create pairs where the local candidate is
/* note: do not create pairs where the local candidate is
* a srv-reflexive (ICE 5.7.3. "Pruning the pairs" ID-9) */
* a srv-reflexive (ICE 5.7.3. "Pruning the pairs" ID-9) */
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
if
((
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
||
...
@@ -1464,6 +1473,8 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
...
@@ -1464,6 +1473,8 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
int
added
=
0
;
int
added
=
0
;
int
ret
=
0
;
int
ret
=
0
;
g_assert
(
remote
!=
NULL
);
for
(
i
=
component
->
local_candidates
;
i
;
i
=
i
->
next
)
{
for
(
i
=
component
->
local_candidates
;
i
;
i
=
i
->
next
)
{
NiceCandidate
*
local
=
i
->
data
;
NiceCandidate
*
local
=
i
->
data
;
...
@@ -1493,6 +1504,8 @@ int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Compo
...
@@ -1493,6 +1504,8 @@ int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Compo
int
added
=
0
;
int
added
=
0
;
int
ret
=
0
;
int
ret
=
0
;
g_assert
(
local
!=
NULL
);
for
(
i
=
component
->
remote_candidates
;
i
;
i
=
i
->
next
)
{
for
(
i
=
component
->
remote_candidates
;
i
;
i
=
i
->
next
)
{
NiceCandidate
*
remote
=
i
->
data
;
NiceCandidate
*
remote
=
i
->
data
;
...
@@ -1954,6 +1967,8 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream,
...
@@ -1954,6 +1967,8 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, Stream *stream,
GSList
*
i
;
GSList
*
i
;
NiceCandidate
*
local
=
NULL
;
NiceCandidate
*
local
=
NULL
;
g_assert
(
remote_cand
!=
NULL
);
for
(
i
=
stream
->
conncheck_list
;
i
;
i
=
i
->
next
)
{
for
(
i
=
stream
->
conncheck_list
;
i
;
i
=
i
->
next
)
{
CandidateCheckPair
*
p
=
i
->
data
;
CandidateCheckPair
*
p
=
i
->
data
;
if
(
p
->
component_id
==
component
->
id
&&
if
(
p
->
component_id
==
component
->
id
&&
...
...
agent/discovery.c
View file @
67392282
...
@@ -309,6 +309,8 @@ static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_
...
@@ -309,6 +309,8 @@ static gboolean priv_add_local_candidate_pruned (NiceAgent *agent, guint stream_
{
{
GSList
*
i
;
GSList
*
i
;
g_assert
(
candidate
!=
NULL
);
for
(
i
=
component
->
local_candidates
;
i
;
i
=
i
->
next
)
{
for
(
i
=
component
->
local_candidates
;
i
;
i
=
i
->
next
)
{
NiceCandidate
*
c
=
i
->
data
;
NiceCandidate
*
c
=
i
->
data
;
...
...
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