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
4d90e7e1
Commit
4d90e7e1
authored
Apr 16, 2014
by
Youness Alaoui
Committed by
Olivier Crête
May 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactor for conncheck add_pair function
parent
4a9f8873
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
agent/conncheck.c
agent/conncheck.c
+28
-16
No files found.
agent/conncheck.c
View file @
4d90e7e1
...
@@ -72,6 +72,7 @@ static size_t priv_create_username (NiceAgent *agent, Stream *stream,
...
@@ -72,6 +72,7 @@ static size_t priv_create_username (NiceAgent *agent, Stream *stream,
static
size_t
priv_get_password
(
NiceAgent
*
agent
,
Stream
*
stream
,
static
size_t
priv_get_password
(
NiceAgent
*
agent
,
Stream
*
stream
,
NiceCandidate
*
remote
,
uint8_t
**
password
);
NiceCandidate
*
remote
,
uint8_t
**
password
);
static
void
conn_check_free_item
(
gpointer
data
);
static
void
conn_check_free_item
(
gpointer
data
);
static
void
priv_conn_check_add_for_candidate_pair_matched
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
);
static
int
priv_timer_expired
(
GTimeVal
*
timer
,
GTimeVal
*
now
)
static
int
priv_timer_expired
(
GTimeVal
*
timer
,
GTimeVal
*
now
)
{
{
...
@@ -1336,7 +1337,30 @@ conn_check_match_transport (NiceCandidateTransport transport)
...
@@ -1336,7 +1337,30 @@ conn_check_match_transport (NiceCandidateTransport transport)
}
}
}
}
static
gboolean
priv_conn_check_add_for_candidate_pair
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
)
static
void
priv_conn_check_add_for_candidate_pair_matched
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
)
{
nice_debug
(
"Agent %p, Adding check pair between %s and %s"
,
agent
,
local
->
foundation
,
remote
->
foundation
);
priv_add_new_check_pair
(
agent
,
stream_id
,
component
,
local
,
remote
,
NICE_CHECK_FROZEN
,
FALSE
);
if
(
component
->
state
<
NICE_COMPONENT_STATE_CONNECTED
)
{
agent_signal_component_state_change
(
agent
,
stream_id
,
component
->
id
,
NICE_COMPONENT_STATE_CONNECTING
);
}
else
{
agent_signal_component_state_change
(
agent
,
stream_id
,
component
->
id
,
NICE_COMPONENT_STATE_CONNECTED
);
}
}
static
gboolean
priv_conn_check_add_for_candidate_pair
(
NiceAgent
*
agent
,
guint
stream_id
,
Component
*
component
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
)
{
{
gboolean
ret
=
FALSE
;
gboolean
ret
=
FALSE
;
...
@@ -1354,25 +1378,13 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent, guint
...
@@ -1354,25 +1378,13 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent, guint
if
(
local
->
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
)
{
if
(
local
->
transport
==
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
)
{
return
FALSE
;
return
FALSE
;
}
}
/* note: match pairs only if transport and address family are the same */
/* note: match pairs only if transport and address family are the same */
if
(
local
->
transport
==
conn_check_match_transport
(
remote
->
transport
)
&&
if
(
local
->
transport
==
conn_check_match_transport
(
remote
->
transport
)
&&
local
->
addr
.
s
.
addr
.
sa_family
==
remote
->
addr
.
s
.
addr
.
sa_family
)
{
local
->
addr
.
s
.
addr
.
sa_family
==
remote
->
addr
.
s
.
addr
.
sa_family
)
{
priv_conn_check_add_for_candidate_pair_matched
(
agent
,
stream_id
,
component
,
nice_debug
(
"Agent %p, Adding check pair between %s and %s"
,
agent
,
local
,
remote
);
local
->
foundation
,
remote
->
foundation
);
priv_add_new_check_pair
(
agent
,
stream_id
,
component
,
local
,
remote
,
NICE_CHECK_FROZEN
,
FALSE
);
ret
=
TRUE
;
ret
=
TRUE
;
if
(
component
->
state
<
NICE_COMPONENT_STATE_CONNECTED
)
{
agent_signal_component_state_change
(
agent
,
stream_id
,
component
->
id
,
NICE_COMPONENT_STATE_CONNECTING
);
}
else
{
agent_signal_component_state_change
(
agent
,
stream_id
,
component
->
id
,
NICE_COMPONENT_STATE_CONNECTED
);
}
}
}
return
ret
;
return
ret
;
...
...
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