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
231943d2
Commit
231943d2
authored
May 20, 2010
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
discovery: Remove useless checks from discovery_add_relay_candidate
parent
df2db74e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
43 deletions
+35
-43
agent/discovery.c
agent/discovery.c
+35
-43
No files found.
agent/discovery.c
View file @
231943d2
...
@@ -602,57 +602,49 @@ discovery_add_relay_candidate (
...
@@ -602,57 +602,49 @@ discovery_add_relay_candidate (
return
NULL
;
return
NULL
;
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_RELAYED
);
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_RELAYED
);
if
(
candidate
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
candidate
->
priority
=
nice_candidate_jingle_priority
(
candidate
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
candidate
->
priority
=
nice_candidate_msn_priority
(
candidate
);
}
else
{
candidate
->
priority
=
nice_candidate_ice_priority_full
(
NICE_CANDIDATE_TYPE_PREF_RELAYED
,
0
,
component_id
);
}
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
candidate
->
turn
=
turn
;
/* step: link to the base candidate+socket */
relay_socket
=
nice_turn_socket_new
(
agent
,
address
,
base_socket
,
&
turn
->
server
,
turn
->
username
,
turn
->
password
,
agent_to_turn_socket_compatibility
(
agent
));
if
(
relay_socket
)
{
candidate
->
sockptr
=
relay_socket
;
candidate
->
base_addr
=
base_socket
->
addr
;
priv_generate_candidate_credentials
(
agent
,
candidate
);
/* Google uses the turn username as the candidate username */
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
candidate
->
priority
=
nice_candidate_jingle_priority
(
candidate
);
g_free
(
candidate
->
username
);
}
else
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
candidate
->
username
=
g_strdup
(
turn
->
username
);
candidate
->
priority
=
nice_candidate_msn_priority
(
candidate
);
}
else
{
candidate
->
priority
=
nice_candidate_ice_priority_full
(
NICE_CANDIDATE_TYPE_PREF_RELAYED
,
0
,
component_id
);
}
}
candidate
->
stream_id
=
stream_id
;
candidate
->
component_id
=
component_id
;
candidate
->
addr
=
*
address
;
candidate
->
turn
=
turn
;
/* step: link to the base candidate+socket */
priv_assign_foundation
(
agent
,
candidate
);
relay_socket
=
nice_turn_socket_new
(
agent
,
address
,
base_socket
,
&
turn
->
server
,
turn
->
username
,
turn
->
password
,
agent_to_turn_socket_compatibility
(
agent
));
if
(
relay_socket
)
{
candidate
->
sockptr
=
relay_socket
;
candidate
->
base_addr
=
base_socket
->
addr
;
priv_generate_candidate_credentials
(
agent
,
candidate
);
/* Google uses the turn username as the candidate username */
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
)
{
g_free
(
candidate
->
username
);
candidate
->
username
=
g_strdup
(
turn
->
username
);
}
priv_assign_foundation
(
agent
,
candidate
);
result
=
priv_add_local_candidate_pruned
(
component
,
candidate
);
result
=
priv_add_local_candidate_pruned
(
component
,
candidate
);
if
(
result
)
{
if
(
result
)
{
GSList
*
modified_list
=
g_slist_append
(
component
->
sockets
,
relay_socket
);
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
relay_socket
);
if
(
modified_list
)
{
agent_signal_new_candidate
(
agent
,
candidate
);
/* success: store a pointer to the sockaddr */
component
->
sockets
=
modified_list
;
}
agent_signal_new_candidate
(
agent
,
candidate
);
}
else
{
/* error: memory allocation, or duplicate candidate */
errors
=
TRUE
;
}
}
else
{
}
else
{
/* error:
socket factory mak
e */
/* error:
duplicate candidat
e */
errors
=
TRUE
;
errors
=
TRUE
;
}
}
}
else
{
}
else
{
/* error:
udp socket memory allocation
*/
/* error:
socket factory make
*/
errors
=
TRUE
;
errors
=
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