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
4a1a0b47
Commit
4a1a0b47
authored
Aug 04, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add API to enable/disable debug from libstun
parent
53cccf94
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
agent/conncheck.c
agent/conncheck.c
+11
-0
stun/utils.c
stun/utils.c
+14
-3
stun/utils.h
stun/utils.h
+2
-1
No files found.
agent/conncheck.c
View file @
4a1a0b47
...
@@ -1199,6 +1199,10 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1199,6 +1199,10 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
agent
->
tie_breaker
,
agent
->
tie_breaker
,
priv_agent_to_usage_compatibility
(
agent
));
priv_agent_to_usage_compatibility
(
agent
));
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
g_free
(
password
);
}
stun_timer_start
(
&
pair
->
timer
);
stun_timer_start
(
&
pair
->
timer
);
/* send the conncheck */
/* send the conncheck */
...
@@ -1787,6 +1791,9 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
...
@@ -1787,6 +1791,9 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
valid
=
stun_agent_validate
(
&
agent
->
stun_agent
,
&
req
,
(
uint8_t
*
)
buf
,
len
,
valid
=
stun_agent_validate
(
&
agent
->
stun_agent
,
&
req
,
(
uint8_t
*
)
buf
,
len
,
stun_agent_default_validater
,
validater_data
);
stun_agent_default_validater
,
validater_data
);
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
g_free
(
validater_data
[
0
].
password
);
}
if
(
valid
==
STUN_VALIDATION_NOT_STUN
||
if
(
valid
==
STUN_VALIDATION_NOT_STUN
||
valid
==
STUN_VALIDATION_INCOMPLETE_STUN
||
valid
==
STUN_VALIDATION_INCOMPLETE_STUN
||
...
@@ -1885,6 +1892,10 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
...
@@ -1885,6 +1892,10 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
&
control
,
agent
->
tie_breaker
,
&
control
,
agent
->
tie_breaker
,
priv_agent_to_usage_compatibility
(
agent
));
priv_agent_to_usage_compatibility
(
agent
));
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
)
{
g_free
(
req
.
key
);
}
if
(
res
==
EACCES
)
if
(
res
==
EACCES
)
priv_check_for_role_conflict
(
agent
,
control
);
priv_check_for_role_conflict
(
agent
,
control
);
...
...
stun/utils.c
View file @
4a1a0b47
...
@@ -131,12 +131,23 @@ uint16_t stun_getw (const uint8_t *ptr)
...
@@ -131,12 +131,23 @@ uint16_t stun_getw (const uint8_t *ptr)
/* return stun_find_unknown (msg, &dummy, 1); */
/* return stun_find_unknown (msg, &dummy, 1); */
/* } */
/* } */
static
int
debug_enabled
=
0
;
void
stun_debug_enable
(
void
)
{
debug_enabled
=
1
;
}
void
stun_debug_disable
(
void
)
{
debug_enabled
=
0
;
}
void
stun_debug
(
const
char
*
fmt
,
...)
void
stun_debug
(
const
char
*
fmt
,
...)
{
{
va_list
ap
;
va_list
ap
;
if
(
debug_enabled
)
{
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
vfprintf
(
stderr
,
fmt
,
ap
);
vfprintf
(
stderr
,
fmt
,
ap
);
va_end
(
ap
);
va_end
(
ap
);
}
}
}
void
stun_debug_bytes
(
const
void
*
data
,
size_t
len
)
void
stun_debug_bytes
(
const
void
*
data
,
size_t
len
)
...
...
stun/utils.h
View file @
4a1a0b47
...
@@ -58,8 +58,9 @@ size_t stun_align (size_t l);
...
@@ -58,8 +58,9 @@ size_t stun_align (size_t l);
uint16_t
stun_getw
(
const
uint8_t
*
ptr
);
uint16_t
stun_getw
(
const
uint8_t
*
ptr
);
void
stun_debug_enable
(
void
);
void
stun_debug_disable
(
void
);
void
stun_debug
(
const
char
*
fmt
,
...);
void
stun_debug
(
const
char
*
fmt
,
...);
void
stun_debug_bytes
(
const
void
*
data
,
size_t
len
);
void
stun_debug_bytes
(
const
void
*
data
,
size_t
len
);
int
stun_xor_address
(
const
StunMessage
*
msg
,
int
stun_xor_address
(
const
StunMessage
*
msg
,
...
...
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