From f794f4afaba1422fd1a5d2f8e913951a0961c097 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 22 Aug 2014 14:40:56 +1000 Subject: [PATCH] Add not no utf8 flag to json we know will only contain ascii --- src/generator.c | 8 ++++---- src/stratifier.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/generator.c b/src/generator.c index 9efadd1f..e0b3735a 100644 --- a/src/generator.c +++ b/src/generator.c @@ -263,7 +263,7 @@ retry: send_unix_msg(sockd, "Failed"); goto reconnect; } else { - char *s = json_dumps(gbt->json, 0); + char *s = json_dumps(gbt->json, JSON_NO_UTF8); send_unix_msg(sockd, s); free(s); @@ -915,7 +915,7 @@ static void send_subscribe(proxy_instance_t *proxi, int sockd) json_msg = json_pack("{sssi}", "enonce1", proxi->enonce1, "nonce2len", proxi->nonce2len); - msg = json_dumps(json_msg, 0); + msg = json_dumps(json_msg, JSON_NO_UTF8); json_decref(json_msg); send_unix_msg(sockd, msg); free(msg); @@ -944,7 +944,7 @@ static void send_notify(proxy_instance_t *proxi, int sockd) "clean", ni->clean); mutex_unlock(&proxi->notify_lock); - msg = json_dumps(json_msg, 0); + msg = json_dumps(json_msg, JSON_NO_UTF8); json_decref(json_msg); send_unix_msg(sockd, msg); free(msg); @@ -957,7 +957,7 @@ static void send_diff(proxy_instance_t *proxi, int sockd) char *msg; json_msg = json_pack("{sf}", "diff", proxi->diff); - msg = json_dumps(json_msg, 0); + msg = json_dumps(json_msg, JSON_NO_UTF8); json_decref(json_msg); send_unix_msg(sockd, msg); free(msg); diff --git a/src/stratifier.c b/src/stratifier.c index fc8a0914..9e57ef55 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2368,7 +2368,7 @@ static void *statsupdate(void *arg) "runtime", diff.tv_sec, "Users", stats.users, "Workers", stats.workers); - s = json_dumps(val, 0); + s = json_dumps(val, JSON_NO_UTF8); json_decref(val); LOGNOTICE("Pool:%s", s); fprintf(fp, "%s\n", s); @@ -2381,7 +2381,7 @@ static void *statsupdate(void *arg) "hashrate1hr", suffix60, "hashrate6hr", suffix360, "hashrate1d", suffix1440); - s = json_dumps(val, 0); + s = json_dumps(val, JSON_NO_UTF8); json_decref(val); LOGNOTICE("Pool:%s", s); fprintf(fp, "%s\n", s); @@ -2392,7 +2392,7 @@ static void *statsupdate(void *arg) "SPS5m", sps5, "SPS15m", sps15, "SPS1h", sps60); - s = json_dumps(val, 0); + s = json_dumps(val, JSON_NO_UTF8); json_decref(val); LOGNOTICE("Pool:%s", s); fprintf(fp, "%s\n", s); @@ -2439,7 +2439,7 @@ static void *statsupdate(void *arg) LOGERR("Failed to fopen %s", fname); continue; } - s = json_dumps(val, 0); + s = json_dumps(val, JSON_NO_UTF8); fprintf(fp, "%s\n", s); /* Only display the status of connected users to the * console log. */