projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Slightly randomize all timeouts.
[tinc]
/
src
/
net.c
diff --git
a/src/net.c
b/src/net.c
index
b333c5b
..
77ff1c8
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-164,7
+164,7
@@
static void timeout_handler(int fd, short events, void *event) {
}
}
}
}
- event_add(event, &(struct timeval){pingtimeout, 0});
+ event_add(event, &(struct timeval){pingtimeout,
rand() % 10000
0});
}
static void periodic_handler(int fd, short events, void *event) {
}
static void periodic_handler(int fd, short events, void *event) {
@@
-278,7
+278,7
@@
static void periodic_handler(int fd, short events, void *event) {
}
}
}
}
- event_add(event, &(struct timeval){5, 0});
+ event_add(event, &(struct timeval){5,
rand() % 10000
0});
}
void handle_meta_connection_data(int fd, short events, void *data) {
}
void handle_meta_connection_data(int fd, short events, void *data) {
@@
-449,10
+449,10
@@
int main_loop(void) {
struct event periodic_event;
timeout_set(&timeout_event, timeout_handler, &timeout_event);
struct event periodic_event;
timeout_set(&timeout_event, timeout_handler, &timeout_event);
- event_add(&timeout_event, &(struct timeval){pingtimeout, 0});
+ event_add(&timeout_event, &(struct timeval){pingtimeout,
rand() % 10000
0});
timeout_set(&periodic_event, periodic_handler, &periodic_event);
timeout_set(&periodic_event, periodic_handler, &periodic_event);
- event_add(&periodic_event, &(struct timeval){5, 0});
+ event_add(&periodic_event, &(struct timeval){5,
rand() % 10000
0});
#ifndef HAVE_MINGW
struct event sighup_event;
#ifndef HAVE_MINGW
struct event sighup_event;