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
71b744eb
Commit
71b744eb
authored
May 20, 2010
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent: Remove useless checks and simplify error handling in priv_add_remote_candidate
parent
62991736
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
40 deletions
+34
-40
agent/agent.c
agent/agent.c
+34
-40
No files found.
agent/agent.c
View file @
71b744eb
...
@@ -1907,7 +1907,6 @@ static gboolean priv_add_remote_candidate (
...
@@ -1907,7 +1907,6 @@ static gboolean priv_add_remote_candidate (
{
{
Component
*
component
;
Component
*
component
;
NiceCandidate
*
candidate
;
NiceCandidate
*
candidate
;
gboolean
error_flag
=
FALSE
;
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
NULL
,
&
component
))
if
(
!
agent_find_component
(
agent
,
stream_id
,
component_id
,
NULL
,
&
component
))
return
FALSE
;
return
FALSE
;
...
@@ -1950,13 +1949,12 @@ static gboolean priv_add_remote_candidate (
...
@@ -1950,13 +1949,12 @@ static gboolean priv_add_remote_candidate (
candidate
->
password
=
g_strdup
(
password
);
candidate
->
password
=
g_strdup
(
password
);
}
}
if
(
conn_check_add_for_candidate
(
agent
,
stream_id
,
component
,
candidate
)
<
0
)
if
(
conn_check_add_for_candidate
(
agent
,
stream_id
,
component
,
candidate
)
<
0
)
error_flag
=
TRUE
;
goto
errors
;
}
}
else
{
else
{
/* case 2: add a new candidate */
/* case 2: add a new candidate */
candidate
=
nice_candidate_new
(
type
);
candidate
=
nice_candidate_new
(
type
);
if
(
candidate
)
{
component
->
remote_candidates
=
g_slist_append
(
component
->
remote_candidates
,
component
->
remote_candidates
=
g_slist_append
(
component
->
remote_candidates
,
candidate
);
candidate
);
...
@@ -1966,6 +1964,7 @@ static gboolean priv_add_remote_candidate (
...
@@ -1966,6 +1964,7 @@ static gboolean priv_add_remote_candidate (
candidate
->
type
=
type
;
candidate
->
type
=
type
;
if
(
addr
)
if
(
addr
)
candidate
->
addr
=
*
addr
;
candidate
->
addr
=
*
addr
;
{
{
gchar
tmpbuf
[
INET6_ADDRSTRLEN
]
=
{
0
};
gchar
tmpbuf
[
INET6_ADDRSTRLEN
]
=
{
0
};
if
(
addr
)
if
(
addr
)
...
@@ -1989,19 +1988,14 @@ static gboolean priv_add_remote_candidate (
...
@@ -1989,19 +1988,14 @@ static gboolean priv_add_remote_candidate (
NICE_CANDIDATE_MAX_FOUNDATION
);
NICE_CANDIDATE_MAX_FOUNDATION
);
if
(
conn_check_add_for_candidate
(
agent
,
stream_id
,
component
,
candidate
)
<
0
)
if
(
conn_check_add_for_candidate
(
agent
,
stream_id
,
component
,
candidate
)
<
0
)
error_flag
=
TRUE
;
goto
errors
;
}
else
/* memory alloc error: candidate creation */
error_flag
=
TRUE
;
}
}
if
(
error_flag
)
{
return
TRUE
;
if
(
candidate
)
errors:
nice_candidate_free
(
candidate
);
nice_candidate_free
(
candidate
);
return
FALSE
;
return
FALSE
;
}
return
TRUE
;
}
}
NICEAPI_EXPORT
gboolean
NICEAPI_EXPORT
gboolean
...
...
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