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
305ce1a9
Commit
305ce1a9
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_local_host_candidate
parent
29d993b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
28 deletions
+18
-28
agent/discovery.c
agent/discovery.c
+18
-28
No files found.
agent/discovery.c
View file @
305ce1a9
...
@@ -459,7 +459,6 @@ NiceCandidate *discovery_add_local_host_candidate (
...
@@ -459,7 +459,6 @@ NiceCandidate *discovery_add_local_host_candidate (
Component
*
component
;
Component
*
component
;
Stream
*
stream
;
Stream
*
stream
;
NiceSocket
*
udp_socket
=
NULL
;
NiceSocket
*
udp_socket
=
NULL
;
gboolean
errors
=
FALSE
;
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
&
stream
,
&
component
))
return
NULL
;
return
NULL
;
...
@@ -483,40 +482,31 @@ NiceCandidate *discovery_add_local_host_candidate (
...
@@ -483,40 +482,31 @@ NiceCandidate *discovery_add_local_host_candidate (
/* note: candidate username and password are left NULL as stream
/* note: candidate username and password are left NULL as stream
level ufrag/password are used */
level ufrag/password are used */
udp_socket
=
nice_udp_bsd_socket_new
(
address
);
udp_socket
=
nice_udp_bsd_socket_new
(
address
);
if
(
udp_socket
)
{
if
(
!
udp_socket
)
g
boolean
result
;
g
oto
errors
;
_priv_set_socket_tos
(
agent
,
udp_socket
,
stream
->
tos
);
agent_attach_stream_component_socket
(
agent
,
stream
,
component
,
udp_socket
);
candidate
->
sockptr
=
udp_socket
;
_priv_set_socket_tos
(
agent
,
udp_socket
,
stream
->
tos
)
;
candidate
->
addr
=
udp_socket
->
addr
;
agent_attach_stream_component_socket
(
agent
,
stream
,
candidate
->
base_addr
=
udp_socket
->
addr
;
component
,
udp_socket
)
;
result
=
priv_add_local_candidate_pruned
(
component
,
candidate
);
candidate
->
sockptr
=
udp_socket
;
candidate
->
addr
=
udp_socket
->
addr
;
candidate
->
base_addr
=
udp_socket
->
addr
;
if
(
result
==
TRUE
)
{
if
(
!
priv_add_local_candidate_pruned
(
component
,
candidate
))
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
udp_socket
);
goto
errors
;
agent_signal_new_candidate
(
agent
,
candidate
);
}
else
{
/* error: duplicate candidates */
errors
=
TRUE
;
}
}
else
{
/* error: socket new */
errors
=
TRUE
;
}
/* clean up after errors */
component
->
sockets
=
g_slist_append
(
component
->
sockets
,
udp_socket
);
if
(
errors
)
{
agent_signal_new_candidate
(
agent
,
candidate
);
if
(
candidate
)
nice_candidate_free
(
candidate
),
candidate
=
NULL
;
if
(
udp_socket
)
nice_socket_free
(
udp_socket
);
}
return
candidate
;
return
candidate
;
errors:
nice_candidate_free
(
candidate
);
if
(
udp_socket
)
nice_socket_free
(
udp_socket
);
return
NULL
;
}
}
/*
/*
...
...
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