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
5f031cc8
Commit
5f031cc8
authored
Jul 25, 2014
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change test-icetcp to be more robust against ready->connected->ready state changes
parent
ba4ca9ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
tests/test-icetcp.c
tests/test-icetcp.c
+17
-4
No files found.
tests/test-icetcp.c
View file @
5f031cc8
...
...
@@ -126,15 +126,26 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
static
void
cb_component_state_changed
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
guint
state
,
gpointer
data
)
{
gboolean
ready_to_connected
=
FALSE
;
static
gboolean
quit_called
=
FALSE
;
g_debug
(
"test-icetcp:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
{
if
(
global_lagent_state
[
component_id
-
1
]
==
NICE_COMPONENT_STATE_READY
&&
state
==
NICE_COMPONENT_STATE_CONNECTED
)
ready_to_connected
=
TRUE
;
global_lagent_state
[
component_id
-
1
]
=
state
;
else
if
(
GPOINTER_TO_UINT
(
data
)
==
2
)
}
else
if
(
GPOINTER_TO_UINT
(
data
)
==
2
)
{
if
(
global_ragent_state
[
component_id
-
1
]
==
NICE_COMPONENT_STATE_READY
&&
state
==
NICE_COMPONENT_STATE_CONNECTED
)
ready_to_connected
=
TRUE
;
global_ragent_state
[
component_id
-
1
]
=
state
;
}
if
(
state
==
NICE_COMPONENT_STATE_READY
)
global_components_ready
++
;
else
if
(
state
==
NICE_COMPONENT_STATE_CONNECTED
&&
ready_to_connected
)
global_components_ready
--
;
if
(
state
==
NICE_COMPONENT_STATE_FAILED
)
global_components_failed
++
;
...
...
@@ -143,8 +154,10 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
/* signal status via a global variable */
if
(
global_components_ready
==
global_components_ready_exit
&&
global_components_failed
==
global_components_failed_exit
)
{
global_components_failed
==
global_components_failed_exit
&&
quit_called
==
FALSE
)
{
g_debug
(
"Components ready/failed achieved. Stopping mailoop"
);
quit_called
=
TRUE
;
g_main_loop_quit
(
global_mainloop
);
return
;
}
...
...
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