Browse Source

Merge branch 'master' into userstats

Conflicts:
	src/stratifier.c
master
Con Kolivas 10 years ago
parent
commit
8371a398fe
  1. 10
      src/libckpool.h
  2. 27
      src/stratifier.c

10
src/libckpool.h

@ -279,13 +279,13 @@ typedef struct proc_instance proc_instance_t;
void _json_check(json_t *val, json_error_t *err, const char *file, const char *func, const int line); void _json_check(json_t *val, json_error_t *err, const char *file, const char *func, const int line);
#define json_check(val, err) _json_check(val, err, __FILE__, __func__, __LINE__) #define json_check(VAL, ERR) _json_check(VAL, ERR, __FILE__, __func__, __LINE__)
/* Check and pack json */ /* Check and pack json */
#define JSON_CPACK(val, ...) do { \ #define JSON_CPACK(VAL, ...) do { \
json_error_t err; \ json_error_t ERR; \
val = json_pack_ex(&err, 0, ##__VA_ARGS__); \ VAL = json_pack_ex(&ERR, 0, ##__VA_ARGS__); \
json_check(val, &err); \ json_check(VAL, &ERR); \
} while (0) } while (0)
/* No error checking with these, make sure we know they're valid already! */ /* No error checking with these, make sure we know they're valid already! */

27
src/stratifier.c

@ -2646,19 +2646,20 @@ out:
} }
if (!share) { if (!share) {
JSON_CPACK(val, "{sI,ss,ss,sI,ss,ss,so,si,ss,ss,ss,ss}", val = json_object();
"clientid", client->id, json_set_int(val, "clientid", client->id);
"secondaryuserid", user_instance->secondaryuserid, if (!CKP_STANDALONE(ckp))
"enonce1", client->enonce1, json_set_string(val, "secondaryuserid", user_instance->secondaryuserid);
"workinfoid", sdata->current_workbase->id, json_set_string(val, "enonce1", client->enonce1);
"workername", client->workername, json_set_int(val, "workinfoid", sdata->current_workbase->id);
"username", user_instance->username, json_set_string(val, "workername", client->workername);
"error", json_copy(*err_val), json_set_string(val, "username", user_instance->username);
"errn", err, json_object_set(val, "error", *err_val);
"createdate", cdfield, json_set_int(val, "errn", err);
"createby", "code", json_set_string(val, "createdate", cdfield);
"createcode", __func__, json_set_string(val, "createby", "code");
"createinet", ckp->serverurl[client->server]); json_set_string(val, "createcode", __func__);
json_set_string(val, "createinet", ckp->serverurl[client->server]);
ckdbq_add(ckp, ID_SHAREERR, val); ckdbq_add(ckp, ID_SHAREERR, val);
LOGINFO("Invalid share from client %ld: %s", client->id, client->workername); LOGINFO("Invalid share from client %ld: %s", client->id, client->workername);
} }

Loading…
Cancel
Save