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
2ea8108c
Commit
2ea8108c
authored
May 20, 2010
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: Remove useless checks from priv_add_new_candidate_discovery_turn
parent
c251cbfd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
106 deletions
+85
-106
agent/agent.c
agent/agent.c
+85
-106
No files found.
agent/agent.c
View file @
2ea8108c
...
@@ -1330,19 +1330,12 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -1330,19 +1330,12 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
Stream
*
stream
,
guint
component_id
)
Stream
*
stream
,
guint
component_id
)
{
{
CandidateDiscovery
*
cdisco
;
CandidateDiscovery
*
cdisco
;
GSList
*
modified_list
;
Component
*
component
=
stream_find_component_by_id
(
stream
,
component_id
);
GSList
*
socket_modified_list
;
/* note: no need to check for redundant candidates, as this is
/* note: no need to check for redundant candidates, as this is
* done later on in the process */
* done later on in the process */
cdisco
=
g_slice_new0
(
CandidateDiscovery
);
cdisco
=
g_slice_new0
(
CandidateDiscovery
);
if
(
cdisco
)
{
modified_list
=
g_slist_append
(
agent
->
discovery_list
,
cdisco
);
if
(
modified_list
)
{
Component
*
component
=
stream_find_component_by_id
(
stream
,
component_id
);
cdisco
->
type
=
NICE_CANDIDATE_TYPE_RELAYED
;
cdisco
->
type
=
NICE_CANDIDATE_TYPE_RELAYED
;
if
(
turn
->
type
==
NICE_RELAY_TYPE_TURN_UDP
)
{
if
(
turn
->
type
==
NICE_RELAY_TYPE_TURN_UDP
)
{
...
@@ -1356,14 +1349,8 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -1356,14 +1349,8 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
_priv_set_socket_tos
(
agent
,
new_socket
,
stream
->
tos
);
_priv_set_socket_tos
(
agent
,
new_socket
,
stream
->
tos
);
agent_attach_stream_component_socket
(
agent
,
stream
,
agent_attach_stream_component_socket
(
agent
,
stream
,
component
,
new_socket
);
component
,
new_socket
);
socket_modified_list
=
g_slist_append
(
component
->
sockets
,
new_socket
);
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
new_socket
);
if
(
socket_modified_list
)
{
/* success: store a pointer to the sockaddr */
component
->
sockets
=
socket_modified_list
;
socket
=
new_socket
;
socket
=
new_socket
;
}
else
{
nice_socket_free
(
new_socket
);
}
}
}
}
}
cdisco
->
nicesock
=
socket
;
cdisco
->
nicesock
=
socket
;
...
@@ -1404,19 +1391,15 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -1404,19 +1391,15 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
agent_to_turn_socket_compatibility
(
agent
));
agent_to_turn_socket_compatibility
(
agent
));
if
(
!
cdisco
->
nicesock
)
{
if
(
!
cdisco
->
nicesock
)
{
agent
->
discovery_list
=
g_slist_remove
(
modified_list
,
cdisco
);
g_slice_free
(
CandidateDiscovery
,
cdisco
);
g_slice_free
(
CandidateDiscovery
,
cdisco
);
return
FALSE
;
return
FALSE
;
}
}
agent_attach_stream_component_socket
(
agent
,
stream
,
agent_attach_stream_component_socket
(
agent
,
stream
,
component
,
cdisco
->
nicesock
);
component
,
cdisco
->
nicesock
);
socket_modified_list
=
g_slist_append
(
component
->
sockets
,
cdisco
->
nicesock
);
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
cdisco
->
nicesock
);
if
(
socket_modified_list
)
{
/* success: store a pointer to the sockaddr */
component
->
sockets
=
socket_modified_list
;
}
}
}
cdisco
->
turn
=
turn
;
cdisco
->
turn
=
turn
;
cdisco
->
server
=
turn
->
server
;
cdisco
->
server
=
turn
->
server
;
...
@@ -1444,14 +1427,10 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -1444,14 +1427,10 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
nice_debug
(
"Agent %p : Adding new relay-rflx candidate discovery %p
\n
"
,
nice_debug
(
"Agent %p : Adding new relay-rflx candidate discovery %p
\n
"
,
agent
,
cdisco
);
agent
,
cdisco
);
agent
->
discovery_list
=
modified_list
;
agent
->
discovery_list
=
g_slist_append
(
agent
->
discovery_list
,
cdisco
)
;
++
agent
->
discovery_unsched_items
;
++
agent
->
discovery_unsched_items
;
}
return
TRUE
;
return
TRUE
;
}
return
FALSE
;
}
}
NICEAPI_EXPORT
guint
NICEAPI_EXPORT
guint
...
...
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