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
62991736
Commit
62991736
authored
May 20, 2010
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
discovery: Clean up error handling in discovery_add_relay_candidate
parent
305ce1a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
31 deletions
+23
-31
agent/discovery.c
agent/discovery.c
+23
-31
No files found.
agent/discovery.c
View file @
62991736
...
@@ -583,8 +583,6 @@ discovery_add_relay_candidate (
...
@@ -583,8 +583,6 @@ discovery_add_relay_candidate (
NiceCandidate
*
candidate
;
NiceCandidate
*
candidate
;
Component
*
component
;
Component
*
component
;
Stream
*
stream
;
Stream
*
stream
;
gboolean
result
=
FALSE
;
gboolean
errors
=
FALSE
;
NiceSocket
*
relay_socket
=
NULL
;
NiceSocket
*
relay_socket
=
NULL
;
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
...
@@ -610,7 +608,9 @@ discovery_add_relay_candidate (
...
@@ -610,7 +608,9 @@ discovery_add_relay_candidate (
base_socket
,
&
turn
->
server
,
base_socket
,
&
turn
->
server
,
turn
->
username
,
turn
->
password
,
turn
->
username
,
turn
->
password
,
agent_to_turn_socket_compatibility
(
agent
));
agent_to_turn_socket_compatibility
(
agent
));
if
(
relay_socket
)
{
if
(
!
relay_socket
)
goto
errors
;
candidate
->
sockptr
=
relay_socket
;
candidate
->
sockptr
=
relay_socket
;
candidate
->
base_addr
=
base_socket
->
addr
;
candidate
->
base_addr
=
base_socket
->
addr
;
...
@@ -624,27 +624,19 @@ discovery_add_relay_candidate (
...
@@ -624,27 +624,19 @@ discovery_add_relay_candidate (
priv_assign_foundation
(
agent
,
candidate
);
priv_assign_foundation
(
agent
,
candidate
);
result
=
priv_add_local_candidate_pruned
(
component
,
candidate
);
if
(
!
priv_add_local_candidate_pruned
(
component
,
candidate
))
if
(
result
)
{
goto
errors
;
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
relay_socket
);
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
relay_socket
);
agent_signal_new_candidate
(
agent
,
candidate
);
agent_signal_new_candidate
(
agent
,
candidate
);
}
else
{
/* error: duplicate candidate */
errors
=
TRUE
;
}
}
else
{
/* error: socket factory make */
errors
=
TRUE
;
}
/* clean up after errors */
return
candidate
;
if
(
errors
)
{
if
(
candidate
)
errors:
nice_candidate_free
(
candidate
),
candidate
=
NULL
;
nice_candidate_free
(
candidate
)
;
if
(
relay_socket
)
if
(
relay_socket
)
nice_socket_free
(
relay_socket
);
nice_socket_free
(
relay_socket
);
}
return
NULL
;
return
candidate
;
}
}
/*
/*
...
...
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