From 9346c48e48c95b26a49e4513b83e464b77fb62c3 Mon Sep 17 00:00:00 2001 From: ruti <> Date: Sun, 2 Feb 2025 15:40:47 +0300 Subject: [PATCH] Variable timeout --- desync.c | 2 +- main.c | 7 ++++--- params.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desync.c b/desync.c index 7527fb7..d734ac7 100644 --- a/desync.c +++ b/desync.c @@ -601,7 +601,7 @@ ssize_t desync(struct poolhd *pool, LOG(LOG_S, "split: pos=%ld-%ld (%zd), m: %s\n", lp, pos, s, demode_str[part.m]); if (s == ERR_WAIT) { - set_timer(pool, val, 10); + set_timer(pool, val, params.await_int); return lp - offset; } if (s < 0) { diff --git a/main.c b/main.c index acbe1b8..d2846c5 100644 --- a/main.c +++ b/main.c @@ -45,7 +45,7 @@ fake_udp = { struct params params = { - .wait_send = 1, + .await_int = 10, .cache_ttl = 100800, .ipv6 = 1, @@ -178,7 +178,7 @@ const struct option options[] = { {"tlsrec", 1, 0, 'r'}, {"udp-fake", 1, 0, 'a'}, {"def-ttl", 1, 0, 'g'}, - {"not-wait-send", 0, 0, 'W'}, // + {"await-int", 1, 0, 'W'}, // #ifdef __linux__ {"drop-sack", 0, 0, 'Y'}, {"protect-path", 1, 0, 'P'}, // @@ -1068,8 +1068,9 @@ int main(int argc, char **argv) break; case 'W': - params.wait_send = 0; + params.await_int = atoi(optarg); break; + #ifdef __linux__ case 'P': params.protect_path = optarg; diff --git a/params.h b/params.h index 55c2187..088f5b3 100644 --- a/params.h +++ b/params.h @@ -101,7 +101,7 @@ struct desync_params { struct params { int dp_count; struct desync_params *dp; - bool wait_send; + int await_int; int def_ttl; bool custom_ttl;