From c371f9da9143f133bae5cd905caada482cdd984d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 11 Aug 2014 21:11:19 +1000 Subject: [PATCH] Add command line parameter to set passthrough mode --- src/ckpool.c | 8 ++++++++ src/ckpool.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/ckpool.c b/src/ckpool.c index b4828e33..dd46f162 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -1107,6 +1107,7 @@ static struct option long_options[] = { {"killold", no_argument, 0, 'k'}, {"loglevel", required_argument, 0, 'l'}, {"name", required_argument, 0, 'n'}, + {"passthrough", no_argument, 0, 'P'}, {"proxy", no_argument, 0, 'p'}, {"ckdb-sockdir",required_argument, 0, 'S'}, {"sockdir", required_argument, 0, 's'}, @@ -1179,7 +1180,14 @@ int main(int argc, char **argv) case 'n': ckp.name = optarg; break; + case 'P': + if (ckp.proxy) + quit(1, "Cannot set both proxy and passthrough mode"); + ckp.passthrough = true; + break; case 'p': + if (ckp.passthrough) + quit(1, "Cannot set both passthrough and proxy mode"); ckp.proxy = true; break; case 'S': diff --git a/src/ckpool.h b/src/ckpool.h index 43b14fab..d4260aad 100644 --- a/src/ckpool.h +++ b/src/ckpool.h @@ -127,6 +127,9 @@ struct ckpool_instance { pthread_t pth_listener; pthread_t pth_watchdog; + /* Are we running in passthrough mode */ + bool passthrough; + /* Are we running as a proxy */ bool proxy;