From 7d59f98624670ff2faa485357ad70f762a591d9a Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 7 Oct 2014 17:23:06 +1100 Subject: [PATCH] stratifier - process the heartbeat json --- src/stratifier.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index c5c50066..7ffd4706 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2372,11 +2372,12 @@ static json_params_t *create_json_params(const int64_t client_id, const json_t * static void set_worker_mindiff(ckpool_t *ckp, const char *workername, int mindiff) { worker_instance_t *worker = NULL, *tmp; - char *username = strdupa(workername); + char *username = strdupa(workername), *ignore; user_instance_t *instance = NULL; stratum_instance_t *client; - strsep(&username, "._"); + ignore = username; + strsep(&ignore, "._"); /* Find the user first */ ck_rlock(&instance_lock); @@ -2802,7 +2803,7 @@ static void ckdbq_process(ckpool_t *ckp, char *msg) cmd = response; strsep(&cmd, "."); LOGDEBUG("Got ckdb response: %s cmd %s", response, cmd); - if (cmdmatch("heartbeat=", cmd)) { + if (cmdmatch(cmd, "heartbeat=")) { strsep(&cmd, "="); parse_ckdb_cmd(ckp, cmd); }