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
72f7f85d
Commit
72f7f85d
authored
Apr 30, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Agent pointer info in the g_debug calls...
parent
55ae9288
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
agent/agent.c
agent/agent.c
+11
-10
agent/conncheck.c
agent/conncheck.c
+3
-0
agent/discovery.c
agent/discovery.c
+5
-5
No files found.
agent/agent.c
View file @
72f7f85d
...
@@ -615,8 +615,9 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
...
@@ -615,8 +615,9 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
return
;
return
;
if
(
component
->
state
!=
state
&&
state
<
NICE_COMPONENT_STATE_LAST
)
{
if
(
component
->
state
!=
state
&&
state
<
NICE_COMPONENT_STATE_LAST
)
{
g_debug
(
"
stream %u component %u STATE-CHANGE %u -> %u."
,
g_debug
(
"
Agent %p : stream %u component %u STATE-CHANGE %u -> %u."
,
agent
,
stream_id
,
component_id
,
component
->
state
,
state
);
stream_id
,
component_id
,
component
->
state
,
state
);
component
->
state
=
state
;
component
->
state
=
state
;
g_mutex_unlock
(
agent
->
mutex
);
g_mutex_unlock
(
agent
->
mutex
);
...
@@ -658,7 +659,7 @@ priv_add_srv_rfx_candidate_discovery (NiceAgent *agent, NiceCandidate *host_cand
...
@@ -658,7 +659,7 @@ priv_add_srv_rfx_candidate_discovery (NiceAgent *agent, NiceCandidate *host_cand
cdisco
->
stream
=
stream
;
cdisco
->
stream
=
stream
;
cdisco
->
component
=
stream_find_component_by_id
(
stream
,
component_id
);
cdisco
->
component
=
stream_find_component_by_id
(
stream
,
component_id
);
cdisco
->
agent
=
agent
;
cdisco
->
agent
=
agent
;
g_debug
(
"A
dding new srv-rflx candidate discovery %p
\n
"
,
cdisco
);
g_debug
(
"A
gent %p : Adding new srv-rflx candidate discovery %p
\n
"
,
agent
,
cdisco
);
agent
->
discovery_list
=
modified_list
;
agent
->
discovery_list
=
modified_list
;
++
agent
->
discovery_unsched_items
;
++
agent
->
discovery_unsched_items
;
}
}
...
@@ -700,7 +701,7 @@ nice_agent_add_stream (
...
@@ -700,7 +701,7 @@ nice_agent_add_stream (
modified_list
=
g_slist_append
(
agent
->
streams
,
stream
);
modified_list
=
g_slist_append
(
agent
->
streams
,
stream
);
if
(
modified_list
)
{
if
(
modified_list
)
{
stream
->
id
=
agent
->
next_stream_id
++
;
stream
->
id
=
agent
->
next_stream_id
++
;
g_debug
(
"
allocating stream id %u (%p)"
,
stream
->
id
,
stream
);
g_debug
(
"
Agent %p : allocating stream id %u (%p)"
,
agent
,
stream
->
id
,
stream
);
stream_initialize_credentials
(
stream
,
agent
->
rng
);
stream_initialize_credentials
(
stream
,
agent
->
rng
);
...
@@ -740,7 +741,7 @@ nice_agent_gather_candidates (
...
@@ -740,7 +741,7 @@ nice_agent_gather_candidates (
goto
done
;
goto
done
;
}
}
g_debug
(
"
In %s mode, starting candidate gathering."
,
agent
->
full_mode
?
"ICE-FULL"
:
"ICE-LITE"
);
g_debug
(
"
Agent %p : In %s mode, starting candidate gathering."
,
agent
,
agent
->
full_mode
?
"ICE-FULL"
:
"ICE-LITE"
);
/* generate a local host candidate for each local address */
/* generate a local host candidate for each local address */
...
@@ -905,7 +906,7 @@ static gboolean priv_add_remote_candidate (
...
@@ -905,7 +906,7 @@ static gboolean priv_add_remote_candidate (
/* step: check whether the candidate already exists */
/* step: check whether the candidate already exists */
candidate
=
component_find_remote_candidate
(
component
,
addr
,
transport
);
candidate
=
component_find_remote_candidate
(
component
,
addr
,
transport
);
if
(
candidate
)
{
if
(
candidate
)
{
g_debug
(
"Update existing remote candidate %p."
,
candidate
);
g_debug
(
"Agent %p : Update existing remote candidate %p."
,
agent
,
candidate
);
/* case 1: an existing candidate, update the attributes */
/* case 1: an existing candidate, update the attributes */
candidate
->
type
=
type
;
candidate
->
type
=
type
;
if
(
base_addr
)
if
(
base_addr
)
...
@@ -941,7 +942,7 @@ static gboolean priv_add_remote_candidate (
...
@@ -941,7 +942,7 @@ static gboolean priv_add_remote_candidate (
{
{
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
nice_address_to_string
(
addr
,
tmpbuf
);
nice_address_to_string
(
addr
,
tmpbuf
);
g_debug
(
"A
dding remote candidate with addr [%s]:%u."
,
tmpbuf
,
g_debug
(
"A
gent %p : Adding remote candidate with addr [%s]:%u."
,
agent
,
tmpbuf
,
nice_address_get_port
(
addr
));
nice_address_get_port
(
addr
));
}
}
#endif
#endif
...
@@ -1169,7 +1170,7 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
...
@@ -1169,7 +1170,7 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
if
(
added
>
0
)
{
if
(
added
>
0
)
{
gboolean
res
=
conn_check_schedule_next
(
agent
);
gboolean
res
=
conn_check_schedule_next
(
agent
);
if
(
res
!=
TRUE
)
if
(
res
!=
TRUE
)
g_debug
(
"
Warning: unable to schedule any conn checks!"
);
g_debug
(
"
Agent %p : Warning: unable to schedule any conn checks!"
,
agent
);
}
}
g_mutex_unlock
(
agent
->
mutex
);
g_mutex_unlock
(
agent
->
mutex
);
...
@@ -1202,7 +1203,7 @@ _nice_agent_recv (
...
@@ -1202,7 +1203,7 @@ _nice_agent_recv (
if
(
len
>=
0
)
{
if
(
len
>=
0
)
{
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
nice_address_to_string
(
&
from
,
tmpbuf
);
nice_address_to_string
(
&
from
,
tmpbuf
);
g_debug
(
"
Packet received on local socket %u from [%s]:%u (%u octets)."
,
g_debug
(
"
Agent %p : Packet received on local socket %u from [%s]:%u (%u octets)."
,
agent
,
udp_socket
->
fileno
,
tmpbuf
,
nice_address_get_port
(
&
from
),
len
);
udp_socket
->
fileno
,
tmpbuf
,
nice_address_get_port
(
&
from
),
len
);
}
}
#endif
#endif
...
@@ -1515,7 +1516,7 @@ nice_agent_send (
...
@@ -1515,7 +1516,7 @@ nice_agent_send (
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
gchar
tmpbuf
[
INET6_ADDRSTRLEN
];
nice_address_to_string
(
&
component
->
selected_pair
.
remote
->
addr
,
tmpbuf
);
nice_address_to_string
(
&
component
->
selected_pair
.
remote
->
addr
,
tmpbuf
);
g_debug
(
"
s%d:%d: sending %d bytes to [%s]:%d"
,
stream_id
,
component_id
,
g_debug
(
"
Agent %p : s%d:%d: sending %d bytes to [%s]:%d"
,
agent
,
stream_id
,
component_id
,
len
,
tmpbuf
,
len
,
tmpbuf
,
nice_address_get_port
(
&
component
->
selected_pair
.
remote
->
addr
));
nice_address_get_port
(
&
component
->
selected_pair
.
remote
->
addr
));
#endif
#endif
...
@@ -1787,7 +1788,7 @@ priv_attach_stream_component_socket (NiceAgent *agent,
...
@@ -1787,7 +1788,7 @@ priv_attach_stream_component_socket (NiceAgent *agent,
ctx
=
io_ctx_new
(
agent
,
stream
,
component
,
udp_socket
);
ctx
=
io_ctx_new
(
agent
,
stream
,
component
,
udp_socket
);
g_source_set_callback
(
source
,
(
GSourceFunc
)
nice_agent_g_source_cb
,
g_source_set_callback
(
source
,
(
GSourceFunc
)
nice_agent_g_source_cb
,
ctx
,
(
GDestroyNotify
)
io_ctx_free
);
ctx
,
(
GDestroyNotify
)
io_ctx_free
);
g_debug
(
"A
ttach source %p (stream %u)."
,
source
,
stream
->
id
);
g_debug
(
"A
gent %p : Attach source %p (stream %u)."
,
agent
,
source
,
stream
->
id
);
g_source_attach
(
source
,
component
->
ctx
);
g_source_attach
(
source
,
component
->
ctx
);
component
->
gsources
=
g_slist_append
(
component
->
gsources
,
source
);
component
->
gsources
=
g_slist_append
(
component
->
gsources
,
source
);
}
}
...
...
agent/conncheck.c
View file @
72f7f85d
...
@@ -475,6 +475,7 @@ static gboolean priv_conn_keepalive_tick (gpointer pointer)
...
@@ -475,6 +475,7 @@ static gboolean priv_conn_keepalive_tick (gpointer pointer)
gboolean
conn_check_schedule_next
(
NiceAgent
*
agent
)
gboolean
conn_check_schedule_next
(
NiceAgent
*
agent
)
{
{
gboolean
res
=
priv_conn_check_unfreeze_next
(
agent
);
gboolean
res
=
priv_conn_check_unfreeze_next
(
agent
);
g_debug
(
"Agent %p : priv_conn_check_unfreeze_next returned %d"
,
agent
,
res
);
if
(
agent
->
discovery_unsched_items
>
0
)
if
(
agent
->
discovery_unsched_items
>
0
)
g_debug
(
"Agent %p : WARN: starting conn checks before local candidate gathering is finished."
,
agent
);
g_debug
(
"Agent %p : WARN: starting conn checks before local candidate gathering is finished."
,
agent
);
...
@@ -482,6 +483,7 @@ gboolean conn_check_schedule_next (NiceAgent *agent)
...
@@ -482,6 +483,7 @@ gboolean conn_check_schedule_next (NiceAgent *agent)
if
(
res
==
TRUE
)
{
if
(
res
==
TRUE
)
{
/* step: call once imediately */
/* step: call once imediately */
res
=
priv_conn_check_tick_unlocked
((
gpointer
)
agent
);
res
=
priv_conn_check_tick_unlocked
((
gpointer
)
agent
);
g_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_id
==
0
)
{
...
@@ -495,6 +497,7 @@ gboolean conn_check_schedule_next (NiceAgent *agent)
...
@@ -495,6 +497,7 @@ gboolean conn_check_schedule_next (NiceAgent *agent)
}
}
g_debug
(
"Agent %p : conn_check_schedule_next returning %d"
,
agent
,
res
);
return
res
;
return
res
;
}
}
...
...
agent/discovery.c
View file @
72f7f85d
...
@@ -471,7 +471,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -471,7 +471,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
{
{
static
int
tick_counter
=
0
;
static
int
tick_counter
=
0
;
if
(
tick_counter
++
%
50
==
0
)
if
(
tick_counter
++
%
50
==
0
)
g_debug
(
"
discovery tick #%d with list %p (1)"
,
tick_counter
,
agent
->
discovery_list
);
g_debug
(
"
Agent %p : discovery tick #%d with list %p (1)"
,
agent
,
tick_counter
,
agent
->
discovery_list
);
}
}
#endif
#endif
...
@@ -484,7 +484,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -484,7 +484,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
if
(
agent
->
discovery_unsched_items
)
if
(
agent
->
discovery_unsched_items
)
--
agent
->
discovery_unsched_items
;
--
agent
->
discovery_unsched_items
;
g_debug
(
"
discovery - scheduling cand type %u addr %s and socket %d.
\n
"
,
g_debug
(
"
Agent %p : discovery - scheduling cand type %u addr %s and socket %d.
\n
"
,
agent
,
cand
->
type
,
cand
->
server_addr
,
cand
->
socket
);
cand
->
type
,
cand
->
server_addr
,
cand
->
socket
);
if
(
cand
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
&&
if
(
cand
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
&&
...
@@ -529,7 +529,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -529,7 +529,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
g_get_current_time
(
&
now
);
g_get_current_time
(
&
now
);
if
(
cand
->
stun_ctx
==
NULL
)
{
if
(
cand
->
stun_ctx
==
NULL
)
{
g_debug
(
"
STUN discovery was cancelled, marking discovery done."
);
g_debug
(
"
Agent %p : STUN discovery was cancelled, marking discovery done."
,
agent
);
cand
->
done
=
TRUE
;
cand
->
done
=
TRUE
;
}
}
else
if
(
priv_timer_expired
(
&
cand
->
next_tick
,
&
now
))
{
else
if
(
priv_timer_expired
(
&
cand
->
next_tick
,
&
now
))
{
...
@@ -548,7 +548,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -548,7 +548,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
/* case: error, abort processing */
/* case: error, abort processing */
cand
->
done
=
TRUE
;
cand
->
done
=
TRUE
;
cand
->
stun_ctx
=
NULL
;
cand
->
stun_ctx
=
NULL
;
g_debug
(
"
Error with stun_bind_elapse(), aborting discovery item."
);
g_debug
(
"
Agent %p : Error with stun_bind_elapse(), aborting discovery item."
,
agent
);
}
}
}
}
...
@@ -558,7 +558,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -558,7 +558,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
}
}
if
(
not_done
==
0
)
{
if
(
not_done
==
0
)
{
g_debug
(
"
Candidate gathering FINISHED, stopping discovery timer."
);
g_debug
(
"
Agent %p : Candidate gathering FINISHED, stopping discovery timer."
,
agent
);
discovery_free
(
agent
);
discovery_free
(
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