From 83eb0821ed346e31d68d6d83c89eaafd98c2c680 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 17 Jun 2014 00:22:05 +1000 Subject: [PATCH] Send workinfo sharelog --- src/stratifier.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index 15ea6559..57182c8e 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -401,6 +401,7 @@ static void purge_share_hashtable(int64_t wb_id) /* FIXME This message will be sent to the database once it's hooked in */ static void send_workinfo(ckpool_t *ckp, workbase_t *wb) { + char *msg, *dump, *buf; char cdfield[64]; json_t *val; @@ -423,8 +424,17 @@ static void send_workinfo(ckpool_t *ckp, workbase_t *wb) "createby", "code", "createcode", __func__, "createinet", "127.0.0.1"); -char *dump = json_dumps(val, 0); LOGDEBUG("id.sharelog.json=%s",dump); dealloc(dump); + dump = json_dumps(val, 0); json_decref(val); + ASPRINTF(&msg, "id.sharelog.json=%s", dump); + dealloc(dump); + buf = send_recv_ckdb(ckp, msg); + if (likely(buf)) { + LOGWARNING("Got workinfo response: %s", buf); + dealloc(buf); + } else + LOGWARNING("Got no workinfo response :("); + dealloc(msg); } static void add_base(ckpool_t *ckp, workbase_t *wb, bool *new_block)