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
a7eaf5fe
Commit
a7eaf5fe
authored
Oct 09, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for NICE_DEBUG environment variable
parent
cb09f46c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
agent/agent.c
agent/agent.c
+2
-0
agent/debug.c
agent/debug.c
+35
-3
agent/debug.h
agent/debug.h
+1
-0
No files found.
agent/agent.c
View file @
a7eaf5fe
...
@@ -346,6 +346,8 @@ nice_agent_class_init (NiceAgentClass *klass)
...
@@ -346,6 +346,8 @@ nice_agent_class_init (NiceAgentClass *klass)
G_TYPE_UINT
,
G_TYPE_UINT
,
G_TYPE_INVALID
);
G_TYPE_INVALID
);
/* Init debug options depending on env variables */
nice_debug_init
();
}
}
static
void
priv_generate_tie_breaker
(
NiceAgent
*
agent
)
static
void
priv_generate_tie_breaker
(
NiceAgent
*
agent
)
...
...
agent/debug.c
View file @
a7eaf5fe
...
@@ -42,14 +42,46 @@
...
@@ -42,14 +42,46 @@
#include "stunagent.h"
#include "stunagent.h"
static
int
debug_enabled
=
1
;
static
int
debug_enabled
=
0
;
void
nice_debug_enable
(
gboolean
with_stun
)
{
#define NICE_DEBUG_STUN 1
#define NICE_DEBUG_NICE 2
static
const
GDebugKey
keys
[]
=
{
{
(
gchar
*
)
"stun"
,
NICE_DEBUG_STUN
},
{
(
gchar
*
)
"nice"
,
NICE_DEBUG_NICE
},
{
NULL
,
0
},
};
void
nice_debug_init
()
{
const
gchar
*
flags_string
;
guint
flags
;
flags_string
=
g_getenv
(
"NICE_DEBUG"
);
nice_debug_disable
(
TRUE
);
if
(
flags_string
!=
NULL
)
{
flags
=
g_parse_debug_string
(
flags_string
,
keys
,
2
);
if
(
flags
&
NICE_DEBUG_NICE
)
nice_debug_enable
(
FALSE
);
if
(
flags
&
NICE_DEBUG_STUN
)
stun_debug_enable
();
}
}
void
nice_debug_enable
(
gboolean
with_stun
)
{
debug_enabled
=
1
;
debug_enabled
=
1
;
if
(
with_stun
)
if
(
with_stun
)
stun_debug_enable
();
stun_debug_enable
();
}
}
void
nice_debug_disable
(
gboolean
with_stun
)
{
void
nice_debug_disable
(
gboolean
with_stun
)
{
debug_enabled
=
0
;
debug_enabled
=
0
;
if
(
with_stun
)
if
(
with_stun
)
stun_debug_disable
();
stun_debug_disable
();
...
...
agent/debug.h
View file @
a7eaf5fe
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include <glib.h>
#include <glib.h>
void
nice_debug_init
(
void
);
void
nice_debug_enable
(
gboolean
with_stun
);
void
nice_debug_enable
(
gboolean
with_stun
);
void
nice_debug_disable
(
gboolean
with_stun
);
void
nice_debug_disable
(
gboolean
with_stun
);
void
nice_debug
(
const
char
*
fmt
,
...);
void
nice_debug
(
const
char
*
fmt
,
...);
...
...
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