From e502fde52b17088f84dcd4aef7c71e3f908d4138 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 27 Apr 2012 11:13:52 +1000 Subject: [PATCH] Remove the ability to disable longpoll. It is not a useful feature and will conflict with planned changes to longpoll code. --- README | 1 - cgminer.c | 20 ++------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/README b/README index c9c6eb4c..4298ecab 100644 --- a/README +++ b/README @@ -133,7 +133,6 @@ Options for both config file and command line: --log|-l Interval in seconds between log output (default: 5) --monitor|-m Use custom pipe cmd for output messages --net-delay Impose small delays in networking to not overload slow routers ---no-longpoll Disable X-Long-Polling support --pass|-p Password for bitcoin JSON-RPC server --per-device-stats Force verbose mode and output per-device statistics --protocol-dump|-P Verbose dump of protocol-level activities diff --git a/cgminer.c b/cgminer.c index f596540a..47a43bed 100644 --- a/cgminer.c +++ b/cgminer.c @@ -81,7 +81,6 @@ int gpu_threads; bool opt_protocol = false; static bool opt_benchmark; -static bool want_longpoll = true; static bool have_longpoll = false; static bool want_per_device_stats = false; bool use_syslog = false; @@ -850,9 +849,6 @@ static struct opt_table opt_config_table[] = { opt_hidden #endif ), - OPT_WITHOUT_ARG("--no-longpoll", - opt_set_invbool, &want_longpoll, - "Disable X-Long-Polling support"), OPT_WITHOUT_ARG("--no-restart", opt_set_invbool, &opt_restart, #ifdef HAVE_OPENCL @@ -2019,7 +2015,7 @@ static void *get_work_thread(void *userdata) struct work *ret_work; int failures = 0; - if (unlikely(want_longpoll && !pool->is_lp && pool == current_pool() && + if (unlikely(!pool->is_lp && pool == current_pool() && pool->hdr_path && !pool_tset(pool, &pool->lp_sent))) { stop_longpoll(); start_longpoll(); @@ -2941,7 +2937,6 @@ static void set_options(void) immedok(logwin, true); clear_logwin(); retry: - wlogprint("\n[L]ongpoll: %s\n", want_longpoll ? "On" : "Off"); wlogprint("[Q]ueue: %d\n[S]cantime: %d\n[E]xpiry: %d\n[R]etries: %d\n" "[P]ause: %d\n[W]rite config file\n[C]gminer restart\n", opt_queue, opt_scantime, opt_expiry, opt_retries, opt_fail_pause); @@ -2956,15 +2951,6 @@ retry: } opt_queue = selected; goto retry; - } else if (!strncasecmp(&input, "l", 1)) { - want_longpoll ^= true; - applog(LOG_WARNING, "Longpoll %s", want_longpoll ? "enabled" : "disabled"); - if (!want_longpoll) { - if (have_longpoll) - stop_longpoll(); - } else - start_longpoll(); - goto retry; } else if (!strncasecmp(&input, "s", 1)) { selected = curses_int("Set scantime in seconds"); if (selected < 0 || selected > 9999) { @@ -4693,7 +4679,6 @@ int main(int argc, char *argv[]) if (opt_benchmark) { struct pool *pool; - want_longpoll = false; pool = calloc(sizeof(struct pool), 1); pool->pool_no = 0; pools[total_pools++] = pool; @@ -4985,8 +4970,7 @@ int main(int argc, char *argv[]) } } while (!pools_active); - if (want_longpoll) - start_longpoll(); + start_longpoll(); begin_bench: total_mhashes_done = 0;