From 2e88c53c708b25591df2963b2215c9aeb4d681d5 Mon Sep 17 00:00:00 2001 From: kanoi Date: Wed, 31 Aug 2016 08:55:19 +1000 Subject: [PATCH] ckdb - give workinfo (and others) separate cmd values --- src/ckdb.c | 15 ++++++++++++--- src/ckdb.h | 7 +++++-- src/ckdb_cmd.c | 8 ++++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 78e74607..3f4dc56c 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -6121,7 +6121,10 @@ static void *process_socket(__maybe_unused void *arg) case CMD_AUTH: case CMD_ADDRAUTH: case CMD_HEARTBEAT: - case CMD_SHARELOG: + case CMD_WORKINFO: + case CMD_SHARES: + case CMD_SHAREERRORS: + case CMD_AGEWORKINFO: case CMD_POOLSTAT: case CMD_USERSTAT: case CMD_WORKERSTAT: @@ -6399,7 +6402,10 @@ static void *process_socket(__maybe_unused void *arg) FREENULL(ans); replied = true; // Always queue (ok.queued) - case CMD_SHARELOG: + case CMD_WORKINFO: + case CMD_SHARES: + case CMD_SHAREERRORS: + case CMD_AGEWORKINFO: case CMD_POOLSTAT: case CMD_USERSTAT: case CMD_WORKERSTAT: @@ -6799,7 +6805,10 @@ static void process_reload_item(PGconn *conn, K_ITEM *bq_item) case CMD_ADDRAUTH: if (confirm_sharesummary) break; - case CMD_SHARELOG: + case CMD_WORKINFO: + case CMD_SHARES: + case CMD_SHAREERRORS: + case CMD_AGEWORKINFO: // This will return the same cmdnum or DUP cmdnum = process_seq(msgline); if (cmdnum != CMD_DUPSEQ) { diff --git a/src/ckdb.h b/src/ckdb.h index f29e0ffa..48d4334d 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -58,7 +58,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.7" -#define CKDB_VERSION DB_VERSION"-2.436" +#define CKDB_VERSION DB_VERSION"-2.437" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -677,7 +677,10 @@ enum cmd_values { CMD_VERSION, CMD_LOGLEVEL, CMD_FLUSH, - CMD_SHARELOG, + CMD_WORKINFO, + CMD_SHARES, + CMD_SHAREERRORS, + CMD_AGEWORKINFO, CMD_AUTH, CMD_ADDRAUTH, CMD_ADDUSER, diff --git a/src/ckdb_cmd.c b/src/ckdb_cmd.c index d0101642..48290342 100644 --- a/src/ckdb_cmd.c +++ b/src/ckdb_cmd.c @@ -8448,10 +8448,10 @@ struct CMDS ckdb_cmds[] = { { CMD_VERSION, "version", true, false, NULL, SEQ_NONE, ACCESS_SYSTEM | ACCESS_WEB }, { CMD_LOGLEVEL, "loglevel", true, false, NULL, SEQ_NONE, ACCESS_SYSTEM }, { CMD_FLUSH, "flush", true, false, NULL, SEQ_NONE, ACCESS_SYSTEM }, - { CMD_SHARELOG, STR_WORKINFO, false, true, cmd_sharelog, SEQ_WORKINFO, ACCESS_POOL }, - { CMD_SHARELOG, STR_SHARES, false, true, cmd_sharelog, SEQ_SHARES, ACCESS_POOL }, - { CMD_SHARELOG, STR_SHAREERRORS,false, true, cmd_sharelog, SEQ_SHAREERRORS,ACCESS_POOL }, - { CMD_SHARELOG, STR_AGEWORKINFO,false, true, cmd_sharelog, SEQ_AGEWORKINFO,ACCESS_POOL }, + { CMD_WORKINFO, STR_WORKINFO, false, true, cmd_sharelog, SEQ_WORKINFO, ACCESS_POOL }, + { CMD_SHARES, STR_SHARES, false, true, cmd_sharelog, SEQ_SHARES, ACCESS_POOL }, + { CMD_SHAREERRORS,STR_SHAREERRORS,false,true, cmd_sharelog, SEQ_SHAREERRORS,ACCESS_POOL }, + { CMD_AGEWORKINFO,STR_AGEWORKINFO,false,true, cmd_sharelog, SEQ_AGEWORKINFO,ACCESS_POOL }, { CMD_AUTH, "authorise", false, true, cmd_auth, SEQ_AUTH, ACCESS_POOL }, { CMD_ADDRAUTH, "addrauth", false, true, cmd_addrauth, SEQ_ADDRAUTH, ACCESS_POOL }, { CMD_HEARTBEAT,"heartbeat", false, true, cmd_heartbeat, SEQ_HEARTBEAT, ACCESS_POOL },