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
4d4cbcb8
Commit
4d4cbcb8
authored
Mar 27, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify the return value of stun_agent_finish_message and similar functions
parent
e2f46325
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
34 deletions
+43
-34
agent/conncheck.c
agent/conncheck.c
+43
-34
No files found.
agent/conncheck.c
View file @
4d4cbcb8
...
@@ -594,6 +594,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
...
@@ -594,6 +594,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
g_free
(
password
);
g_free
(
password
);
}
}
if
(
buf_len
>
0
)
{
stun_timer_start
(
&
p
->
keepalive
.
timer
);
stun_timer_start
(
&
p
->
keepalive
.
timer
);
/* send the conncheck */
/* send the conncheck */
...
@@ -614,26 +615,28 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
...
@@ -614,26 +615,28 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
agent_timeout_add_with_context
(
p
->
keepalive
.
agent
,
agent_timeout_add_with_context
(
p
->
keepalive
.
agent
,
stun_timer_remainder
(
&
p
->
keepalive
.
timer
),
stun_timer_remainder
(
&
p
->
keepalive
.
timer
),
priv_conn_keepalive_retransmissions_tick
,
p
);
priv_conn_keepalive_retransmissions_tick
,
p
);
}
}
else
{
if
(
buf_len
==
0
)
++
errors
;
++
errors
;
}
}
}
else
{
}
else
{
buf_len
=
stun_usage_bind_keepalive
(
&
agent
->
stun_agent
,
buf_len
=
stun_usage_bind_keepalive
(
&
agent
->
stun_agent
,
&
p
->
keepalive
.
stun_message
,
p
->
keepalive
.
stun_buffer
,
&
p
->
keepalive
.
stun_message
,
p
->
keepalive
.
stun_buffer
,
sizeof
(
p
->
keepalive
.
stun_buffer
));
sizeof
(
p
->
keepalive
.
stun_buffer
));
if
(
buf_len
>
0
)
{
nice_socket_send
(
p
->
local
->
sockptr
,
&
p
->
remote
->
addr
,
buf_len
,
nice_socket_send
(
p
->
local
->
sockptr
,
&
p
->
remote
->
addr
,
buf_len
,
(
gchar
*
)
p
->
keepalive
.
stun_buffer
);
(
gchar
*
)
p
->
keepalive
.
stun_buffer
);
nice_debug
(
"Agent %p : stun_bind_keepalive for pair %p res %d."
,
nice_debug
(
"Agent %p : stun_bind_keepalive for pair %p res %d."
,
agent
,
p
,
(
int
)
buf_len
);
agent
,
p
,
(
int
)
buf_len
);
if
(
buf_len
==
0
)
}
else
{
++
errors
;
++
errors
;
}
}
}
}
}
}
}
}
}
/* case 2: connectivity establishment ongoing
/* case 2: connectivity establishment ongoing
* (ref ICE sect 4.1.1.4 "Keeping Candidates Alive" ID-19) */
* (ref ICE sect 4.1.1.4 "Keeping Candidates Alive" ID-19) */
...
@@ -1543,6 +1546,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1543,6 +1546,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
g_free
(
password
);
g_free
(
password
);
}
}
if
(
buffer_len
>
0
)
{
stun_timer_start
(
&
pair
->
timer
);
stun_timer_start
(
&
pair
->
timer
);
/* send the conncheck */
/* send the conncheck */
...
@@ -1553,6 +1557,11 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
...
@@ -1553,6 +1557,11 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
/* note: convert from milli to microseconds for g_time_val_add() */
/* note: convert from milli to microseconds for g_time_val_add() */
g_get_current_time
(
&
pair
->
next_tick
);
g_get_current_time
(
&
pair
->
next_tick
);
g_time_val_add
(
&
pair
->
next_tick
,
timeout
*
1000
);
g_time_val_add
(
&
pair
->
next_tick
,
timeout
*
1000
);
}
else
{
pair
->
stun_message
.
buffer
=
NULL
;
pair
->
stun_message
.
buffer_len
=
0
;
return
-
1
;
}
}
}
return
0
;
return
0
;
...
...
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