From 7aab982dc4790c237262c5efe75a53284c587a6b Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 21 Jan 2016 02:40:58 +1100 Subject: [PATCH] Don't generate share error json in standalone mode since it won't be used --- src/stratifier.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 1f0aa513..0efe999b 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -5331,21 +5331,22 @@ out: } if (!share) { - val = json_object(); - json_set_int(val, "clientid", client->id); - if (!CKP_STANDALONE(ckp)) + if (!CKP_STANDALONE(ckp)) { + val = json_object(); + json_set_int(val, "clientid", client->id); json_set_string(val, "secondaryuserid", user->secondaryuserid); - json_set_string(val, "enonce1", client->enonce1); - json_set_int(val, "workinfoid", sdata->current_workbase->id); - json_set_string(val, "workername", client->workername); - json_set_string(val, "username", user->username); - json_object_set(val, "error", *err_val); - json_set_int(val, "errn", err); - json_set_string(val, "createdate", cdfield); - json_set_string(val, "createby", "code"); - json_set_string(val, "createcode", __func__); - json_set_string(val, "createinet", ckp->serverurl[client->server]); - ckdbq_add(ckp, ID_SHAREERR, val); + json_set_string(val, "enonce1", client->enonce1); + json_set_int(val, "workinfoid", sdata->current_workbase->id); + json_set_string(val, "workername", client->workername); + json_set_string(val, "username", user->username); + json_object_set(val, "error", *err_val); + json_set_int(val, "errn", err); + json_set_string(val, "createdate", cdfield); + json_set_string(val, "createby", "code"); + json_set_string(val, "createcode", __func__); + json_set_string(val, "createinet", ckp->serverurl[client->server]); + ckdbq_add(ckp, ID_SHAREERR, val); + } LOGINFO("Invalid share from client %"PRId64": %s", client->id, client->workername); } free(fname);