projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8a6010
)
Revert "Unconditionally remove timeouts from the queue before calling the callback."
author
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 27 Feb 2018 18:11:38 +0000
(19:11 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 27 Feb 2018 18:11:38 +0000
(19:11 +0100)
This reverts commit
e8a60109fc91a42420ec626b63956771675f89b0
.
src/event.c
patch
|
blob
|
history
diff --git
a/src/event.c
b/src/event.c
index 33d205a96f52c1e58b8e1f42150c11ad6633b0a6..331872a5b378d324a66818d34891861e62bde721 100644
(file)
--- a/
src/event.c
+++ b/
src/event.c
@@
-300,9
+300,11
@@
static struct timeval *get_time_remaining(struct timeval *diff) {
timersub(&timeout->tv, &now, diff);
if(diff->tv_sec < 0) {
- timeout_cb_t cb = timeout->cb;
- timeout_del(timeout);
- cb(timeout->data);
+ timeout->cb(timeout->data);
+
+ if(timercmp(&timeout->tv, &now, <)) {
+ timeout_del(timeout);
+ }
} else {
tv = diff;
break;