X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=tungre.cpp;fp=tungre.cpp;h=55bd973602b888bbf57e5e5c63ce8c399667c422;hb=ed84bfc7a5e30f49b35d9a864c6618cb58beb789;hp=ea736fbc2fa600d78738da8c750e0ebd6a1fb77c;hpb=45fc511092347489c5cb6ed76cd5fba593b93fa6;p=greproxy 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(); } }