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
809cea41
Commit
809cea41
authored
Jan 30, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port stun usage timer to use a StunUsageTimerReturn enum
parent
679e7a96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
stun/usages/timer.c
stun/usages/timer.c
+4
-3
stun/usages/timer.h
stun/usages/timer.h
+6
-1
No files found.
stun/usages/timer.c
View file @
809cea41
...
@@ -152,16 +152,17 @@ unsigned stun_timer_remainder (const stun_timer_t *timer)
...
@@ -152,16 +152,17 @@ unsigned stun_timer_remainder (const stun_timer_t *timer)
}
}
int
stun_timer_refresh
(
stun_timer_t
*
timer
)
StunUsageTimerReturn
stun_timer_refresh
(
stun_timer_t
*
timer
)
{
{
unsigned
delay
=
stun_timer_remainder
(
timer
);
unsigned
delay
=
stun_timer_remainder
(
timer
);
if
(
delay
==
0
)
if
(
delay
==
0
)
{
{
if
(
timer
->
delay
>=
STUN_END_TIMEOUT
)
if
(
timer
->
delay
>=
STUN_END_TIMEOUT
)
return
-
1
;
return
STUN_USAGE_TIMER_RETURN_TIMEOUT
;
add_delay
(
&
timer
->
deadline
,
timer
->
delay
*=
2
);
add_delay
(
&
timer
->
deadline
,
timer
->
delay
*=
2
);
return
STUN_USAGE_TIMER_RETURN_RETRANSMIT
;
}
}
return
delay
;
return
STUN_USAGE_TIMER_RETURN_SUCCESS
;
}
}
stun/usages/timer.h
View file @
809cea41
...
@@ -54,6 +54,11 @@ typedef struct stun_timer_s
...
@@ -54,6 +54,11 @@ typedef struct stun_timer_s
unsigned
delay
;
unsigned
delay
;
}
stun_timer_t
;
}
stun_timer_t
;
typedef
enum
{
STUN_USAGE_TIMER_RETURN_SUCCESS
,
STUN_USAGE_TIMER_RETURN_RETRANSMIT
,
STUN_USAGE_TIMER_RETURN_TIMEOUT
}
StunUsageTimerReturn
;
# ifdef __cplusplus
# ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -73,7 +78,7 @@ void stun_timer_start_reliable (stun_timer_t *timer);
...
@@ -73,7 +78,7 @@ void stun_timer_start_reliable (stun_timer_t *timer);
* 0 if the transaction should be retransmitted,
* 0 if the transaction should be retransmitted,
* otherwise milliseconds left until next time out or retransmit.
* otherwise milliseconds left until next time out or retransmit.
*/
*/
int
stun_timer_refresh
(
stun_timer_t
*
timer
);
StunUsageTimerReturn
stun_timer_refresh
(
stun_timer_t
*
timer
);
unsigned
stun_timer_remainder
(
const
stun_timer_t
*
timer
);
unsigned
stun_timer_remainder
(
const
stun_timer_t
*
timer
);
# ifdef __cplusplus
# ifdef __cplusplus
...
...
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