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
3647a7ae
Commit
3647a7ae
authored
May 20, 2010
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conncheck: Remove useless checks from priv_add_new_check_pair
parent
f4ae3ffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
44 deletions
+26
-44
agent/conncheck.c
agent/conncheck.c
+26
-44
No files found.
agent/conncheck.c
View file @
3647a7ae
...
...
@@ -1254,55 +1254,37 @@ static gboolean priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Comp
gboolean
result
=
FALSE
;
Stream
*
stream
=
agent_find_stream
(
agent
,
stream_id
);
CandidateCheckPair
*
pair
=
g_slice_new0
(
CandidateCheckPair
);
if
(
pair
)
{
GSList
*
modified_list
=
g_slist_insert_sorted
(
stream
->
conncheck_list
,
pair
,
(
GCompareFunc
)
conn_check_compare
);
if
(
modified_list
)
{
/* step: allocation and addition succesful, do rest of the work */
pair
->
agent
=
agent
;
pair
->
stream_id
=
stream_id
;
pair
->
component_id
=
component
->
id
;;
pair
->
local
=
local
;
pair
->
remote
=
remote
;
g_snprintf
(
pair
->
foundation
,
NICE_CANDIDATE_PAIR_MAX_FOUNDATION
,
"%s:%s"
,
local
->
foundation
,
remote
->
foundation
);
pair
->
priority
=
agent_candidate_pair_priority
(
agent
,
local
,
remote
);
pair
->
state
=
initial_state
;
nice_debug
(
"Agent %p : creating new pair %p state %d"
,
agent
,
pair
,
initial_state
);
pair
->
nominated
=
use_candidate
;
pair
->
controlling
=
agent
->
controlling_mode
;
/* note: for the first added check */
if
(
!
stream
->
conncheck_list
)
stream
->
conncheck_state
=
NICE_CHECKLIST_RUNNING
;
stream
->
conncheck_list
=
modified_list
;
stream
->
conncheck_list
=
g_slist_insert_sorted
(
stream
->
conncheck_list
,
pair
,
(
GCompareFunc
)
conn_check_compare
);
result
=
TRUE
;
nice_debug
(
"Agent %p : added a new conncheck %p with foundation of '%s' to list %u."
,
agent
,
pair
,
pair
->
foundation
,
stream_id
);
pair
->
agent
=
agent
;
pair
->
stream_id
=
stream_id
;
pair
->
component_id
=
component
->
id
;;
pair
->
local
=
local
;
pair
->
remote
=
remote
;
g_snprintf
(
pair
->
foundation
,
NICE_CANDIDATE_PAIR_MAX_FOUNDATION
,
"%s:%s"
,
local
->
foundation
,
remote
->
foundation
);
/* implement the hard upper limit for number of
checks (see sect 5.7.3 ICE ID-19): */
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
)
{
stream
->
conncheck_list
=
priv_limit_conn_check_list_size
(
stream
->
conncheck_list
,
agent
->
max_conn_checks
);
}
if
(
!
stream
->
conncheck_list
)
{
stream
->
conncheck_state
=
NICE_CHECKLIST_FAILED
;
result
=
FALSE
;
}
}
else
{
/* memory alloc failed: list insert */
conn_check_free_item
(
pair
,
NULL
);
stream
->
conncheck_state
=
NICE_CHECKLIST_FAILED
;
}
}
else
{
/* memory alloc failed: new pair */
stream
->
conncheck_state
=
NICE_CHECKLIST_FAILED
;
pair
->
priority
=
agent_candidate_pair_priority
(
agent
,
local
,
remote
);
pair
->
state
=
initial_state
;
nice_debug
(
"Agent %p : creating new pair %p state %d"
,
agent
,
pair
,
initial_state
);
pair
->
nominated
=
use_candidate
;
pair
->
controlling
=
agent
->
controlling_mode
;
/* note: for the first added check */
if
(
!
stream
->
conncheck_list
)
stream
->
conncheck_state
=
NICE_CHECKLIST_RUNNING
;
nice_debug
(
"Agent %p : added a new conncheck %p with foundation of '%s' to list %u."
,
agent
,
pair
,
pair
->
foundation
,
stream_id
);
/* implement the hard upper limit for number of
checks (see sect 5.7.3 ICE ID-19): */
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_RFC5245
)
{
stream
->
conncheck_list
=
priv_limit_conn_check_list_size
(
stream
->
conncheck_list
,
agent
->
max_conn_checks
);
}
return
result
;
return
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