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
675d1d20
Commit
675d1d20
authored
Sep 22, 2008
by
Sjoerd Simons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove timeout sources from the right context
parent
f543d6b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
25 deletions
+28
-25
agent/agent-priv.h
agent/agent-priv.h
+4
-4
agent/agent.c
agent/agent.c
+9
-9
agent/conncheck.c
agent/conncheck.c
+8
-7
agent/discovery.c
agent/discovery.c
+7
-5
No files found.
agent/agent-priv.h
View file @
675d1d20
...
@@ -86,9 +86,9 @@ struct _NiceAgent
...
@@ -86,9 +86,9 @@ struct _NiceAgent
NiceRNG
*
rng
;
/**< random number generator */
NiceRNG
*
rng
;
/**< random number generator */
GSList
*
discovery_list
;
/**< list of CandidateDiscovery items */
GSList
*
discovery_list
;
/**< list of CandidateDiscovery items */
guint
discovery_unsched_items
;
/**< number of discovery items unscheduled */
guint
discovery_unsched_items
;
/**< number of discovery items unscheduled */
guint
discovery_timer_id
;
/**< id
of discovery timer */
GSource
*
discovery_timer_source
;
/**< source
of discovery timer */
guint
conncheck_timer_id
;
/**< id of discovery
timer */
GSource
*
conncheck_timer_source
;
/**< source of conncheck
timer */
guint
keepalive_timer_id
;
/**< id
of keepalive timer */
GSource
*
keepalive_timer_source
;
/**< source
of keepalive timer */
guint64
tie_breaker
;
/**< tie breaker (ICE sect 5.2
guint64
tie_breaker
;
/**< tie breaker (ICE sect 5.2
"Determining Role" ID-19) */
"Determining Role" ID-19) */
GStaticRecMutex
mutex
;
/* Mutex used for thread-safe lib */
GStaticRecMutex
mutex
;
/* Mutex used for thread-safe lib */
...
@@ -133,7 +133,7 @@ void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *st
...
@@ -133,7 +133,7 @@ void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *st
guint64
agent_candidate_pair_priority
(
NiceAgent
*
agent
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
);
guint64
agent_candidate_pair_priority
(
NiceAgent
*
agent
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
);
guint
agent_timeout_add_with_context
(
NiceAgent
*
agent
,
guint
interval
,
GSourceFunc
function
,
gpointer
data
);
GSource
*
agent_timeout_add_with_context
(
NiceAgent
*
agent
,
guint
interval
,
GSourceFunc
function
,
gpointer
data
);
void
priv_attach_stream_component_socket
(
NiceAgent
*
agent
,
void
priv_attach_stream_component_socket
(
NiceAgent
*
agent
,
Stream
*
stream
,
Stream
*
stream
,
...
...
agent/agent.c
View file @
675d1d20
...
@@ -367,9 +367,9 @@ nice_agent_init (NiceAgent *agent)
...
@@ -367,9 +367,9 @@ nice_agent_init (NiceAgent *agent)
agent
->
discovery_list
=
NULL
;
agent
->
discovery_list
=
NULL
;
agent
->
discovery_unsched_items
=
0
;
agent
->
discovery_unsched_items
=
0
;
agent
->
discovery_timer_
id
=
0
;
agent
->
discovery_timer_
source
=
NULL
;
agent
->
conncheck_timer_
id
=
0
;
agent
->
conncheck_timer_
source
=
NULL
;
agent
->
keepalive_timer_
id
=
0
;
agent
->
keepalive_timer_
source
=
NULL
;
agent
->
compatibility
=
NICE_COMPATIBILITY_DRAFT19
;
agent
->
compatibility
=
NICE_COMPATIBILITY_DRAFT19
;
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
stun_agent_init
(
&
agent
->
stun_agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
...
@@ -909,9 +909,10 @@ nice_agent_gather_candidates (
...
@@ -909,9 +909,10 @@ nice_agent_gather_candidates (
static
void
priv_remove_keepalive_timer
(
NiceAgent
*
agent
)
static
void
priv_remove_keepalive_timer
(
NiceAgent
*
agent
)
{
{
if
(
agent
->
keepalive_timer_id
)
{
if
(
agent
->
keepalive_timer_source
!=
NULL
)
{
g_source_remove
(
agent
->
keepalive_timer_id
),
g_source_destroy
(
agent
->
keepalive_timer_source
);
agent
->
keepalive_timer_id
=
0
;
g_source_unref
(
agent
->
keepalive_timer_source
);
agent
->
keepalive_timer_source
=
NULL
;
}
}
}
}
...
@@ -2042,7 +2043,7 @@ nice_agent_set_selected_pair (
...
@@ -2042,7 +2043,7 @@ nice_agent_set_selected_pair (
}
}
guint
agent_timeout_add_with_context
(
NiceAgent
*
agent
,
guint
interval
,
GSource
*
agent_timeout_add_with_context
(
NiceAgent
*
agent
,
guint
interval
,
GSourceFunc
function
,
gpointer
data
)
GSourceFunc
function
,
gpointer
data
)
{
{
GSource
*
source
;
GSource
*
source
;
...
@@ -2054,9 +2055,8 @@ guint agent_timeout_add_with_context (NiceAgent *agent, guint interval,
...
@@ -2054,9 +2055,8 @@ guint agent_timeout_add_with_context (NiceAgent *agent, guint interval,
g_source_set_callback
(
source
,
function
,
data
,
NULL
);
g_source_set_callback
(
source
,
function
,
data
,
NULL
);
id
=
g_source_attach
(
source
,
agent
->
main_context
);
id
=
g_source_attach
(
source
,
agent
->
main_context
);
g_source_unref
(
source
);
return
id
;
return
source
;
}
}
...
...
agent/conncheck.c
View file @
675d1d20
...
@@ -537,13 +537,13 @@ gboolean conn_check_schedule_next (NiceAgent *agent)
...
@@ -537,13 +537,13 @@ gboolean conn_check_schedule_next (NiceAgent *agent)
nice_debug
(
"Agent %p : priv_conn_check_tick_unlocked returned %d"
,
agent
,
res
);
nice_debug
(
"Agent %p : priv_conn_check_tick_unlocked returned %d"
,
agent
,
res
);
/* step: schedule timer if not running yet */
/* step: schedule timer if not running yet */
if
(
res
&&
agent
->
conncheck_timer_
id
==
0
)
{
if
(
res
&&
agent
->
conncheck_timer_
source
==
NULL
)
{
agent
->
conncheck_timer_
id
=
agent_timeout_add_with_context
(
agent
,
agent
->
timer_ta
,
priv_conn_check_tick
,
agent
);
agent
->
conncheck_timer_
source
=
agent_timeout_add_with_context
(
agent
,
agent
->
timer_ta
,
priv_conn_check_tick
,
agent
);
}
}
/* step: also start the keepalive timer */
/* step: also start the keepalive timer */
if
(
agent
->
keepalive_timer_
id
==
0
)
{
if
(
agent
->
keepalive_timer_
source
==
NULL
)
{
agent
->
keepalive_timer_
id
=
agent_timeout_add_with_context
(
agent
,
NICE_AGENT_TIMER_TR_DEFAULT
,
priv_conn_keepalive_tick
,
agent
);
agent
->
keepalive_timer_
source
=
agent_timeout_add_with_context
(
agent
,
NICE_AGENT_TIMER_TR_DEFAULT
,
priv_conn_keepalive_tick
,
agent
);
}
}
}
}
...
@@ -951,9 +951,10 @@ void conn_check_free (NiceAgent *agent)
...
@@ -951,9 +951,10 @@ void conn_check_free (NiceAgent *agent)
}
}
}
}
if
(
agent
->
conncheck_timer_id
)
{
if
(
agent
->
conncheck_timer_source
!=
NULL
)
{
g_source_remove
(
agent
->
conncheck_timer_id
),
g_source_destroy
(
agent
->
conncheck_timer_source
);
agent
->
conncheck_timer_id
=
0
;
g_source_unref
(
agent
->
conncheck_timer_source
);
agent
->
conncheck_timer_source
=
NULL
;
}
}
}
}
...
...
agent/discovery.c
View file @
675d1d20
...
@@ -117,9 +117,11 @@ void discovery_free (NiceAgent *agent)
...
@@ -117,9 +117,11 @@ void discovery_free (NiceAgent *agent)
agent
->
discovery_unsched_items
=
0
;
agent
->
discovery_unsched_items
=
0
;
}
}
if
(
agent
->
discovery_timer_id
)
if
(
agent
->
discovery_timer_source
!=
NULL
)
{
g_source_remove
(
agent
->
discovery_timer_id
),
g_source_destroy
(
agent
->
discovery_timer_source
);
agent
->
discovery_timer_id
=
0
;
g_source_unref
(
agent
->
discovery_timer_source
);
agent
->
discovery_timer_source
=
NULL
;
}
}
}
/**
/**
...
@@ -843,11 +845,11 @@ void discovery_schedule (NiceAgent *agent)
...
@@ -843,11 +845,11 @@ void discovery_schedule (NiceAgent *agent)
if
(
agent
->
discovery_unsched_items
>
0
)
{
if
(
agent
->
discovery_unsched_items
>
0
)
{
if
(
agent
->
discovery_timer_
id
==
0
)
{
if
(
agent
->
discovery_timer_
source
==
NULL
)
{
/* step: run first iteration immediately */
/* step: run first iteration immediately */
gboolean
res
=
priv_discovery_tick_unlocked
(
agent
);
gboolean
res
=
priv_discovery_tick_unlocked
(
agent
);
if
(
res
==
TRUE
)
{
if
(
res
==
TRUE
)
{
agent
->
discovery_timer_
id
=
agent_timeout_add_with_context
(
agent
,
agent
->
timer_ta
,
priv_discovery_tick
,
agent
);
agent
->
discovery_timer_
source
=
agent_timeout_add_with_context
(
agent
,
agent
->
timer_ta
,
priv_discovery_tick
,
agent
);
}
}
}
}
}
}
...
...
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