From ed84bfc7a5e30f49b35d9a864c6618cb58beb789 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 8 Feb 2015 21:59:06 +0100 Subject: [PATCH] Unbreak pacing in tungre. --- tungre.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tungre.cpp b/tungre.cpp index ea736fb..55bd973 100644 --- a/tungre.cpp +++ b/tungre.cpp @@ -37,9 +37,11 @@ int main(int argc, char **argv) fd_set fds; FD_ZERO(&fds); for ( ;; ) { + timeval tv = { 1, 0 }; FD_SET(gre.fd(), &fds); FD_SET(tun.fd(), &fds); - int ret = select(1024, &fds, NULL, NULL, NULL); + tun_pacer.possibly_adjust_tv(&tv); + int ret = select(1024, &fds, NULL, NULL, &tv); if (ret == -1) { perror("select"); continue; @@ -51,5 +53,6 @@ int main(int argc, char **argv) if (FD_ISSET(tun.fd(), &fds)) { tun.read_packet(&gre_pacer); } + tun_pacer.possibly_flush_packets(); } } -- 2.39.2