Make it possible to enable/disable longpoll.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/main.c b/main.c
index ab1fff7..3ceab20 100644
--- a/main.c
+++ b/main.c
@@ -1604,7 +1604,9 @@ static void set_options(void)
opt_loginput = true;
immedok(logwin, true);
retry:
- wprintw(logwin, "\nToggle [D]ynamic mode\n");
+ wclear(logwin);
+ wprintw(logwin, "\n[D]ynamic mode: %s\n[L]ongpoll: %s\n",
+ opt_dynamic ? "On" : "Off", want_longpoll ? "On" : "Off");
if (opt_dynamic)
wprintw(logwin, "[I]ntensity: Dynamic\n");
else
@@ -1621,9 +1623,15 @@ retry:
goto retry;
}
opt_queue = selected;
+ goto retry;
} else if (!strncasecmp(&input, "d", 1)) {
opt_dynamic ^= true;
- applog(LOG_WARNING, "Dynamic mode %s", opt_dynamic ? "enabled" : "disabled");
+ goto retry;
+ } else if (!strncasecmp(&input, "l", 1)) {
+ want_longpoll ^= true;
+ applog(LOG_WARNING, "Longpoll %s", want_longpoll ? "enabled" : "disabled");
+ restart_longpoll();
+ goto retry;
} else if (!strncasecmp(&input, "i", 1)) {
selected = curses_int("Set GPU scan intensity (0-10)");
if (selected < 0 || selected > 10) {
@@ -1632,6 +1640,7 @@ retry:
}
opt_dynamic = false;
scan_intensity = selected;
+ goto retry;
} else if (!strncasecmp(&input, "s", 1)) {
selected = curses_int("Set scantime in seconds");
if (selected < 0 || selected > 9999) {
@@ -1639,6 +1648,7 @@ retry:
goto retry;
}
opt_scantime = selected;
+ goto retry;
} else if (!strncasecmp(&input, "r", 1)) {
selected = curses_int("Retries before failing (-1 infinite)");
if (selected < -1 || selected > 9999) {
@@ -1646,6 +1656,7 @@ retry:
goto retry;
}
opt_retries = selected;
+ goto retry;
} else if (!strncasecmp(&input, "p", 1)) {
selected = curses_int("Seconds to pause before network retries");
if (selected < 1 || selected > 9999) {
@@ -1653,6 +1664,7 @@ retry:
goto retry;
}
opt_fail_pause = selected;
+ goto retry;
}
wclear(logwin);
immedok(logwin, false);