|
|
@ -204,8 +204,6 @@ static const char ISJSON = '{'; |
|
|
|
#define JSON_GPUS JSON1 _GPUS JSON2 |
|
|
|
#define JSON_GPUS JSON1 _GPUS JSON2 |
|
|
|
#define JSON_NOTIFY JSON1 _NOTIFY JSON2 |
|
|
|
#define JSON_NOTIFY JSON1 _NOTIFY JSON2 |
|
|
|
#define JSON_DEVDETAILS JSON1 _DEVDETAILS JSON2 |
|
|
|
#define JSON_DEVDETAILS JSON1 _DEVDETAILS JSON2 |
|
|
|
#define JSON_BYE JSON1 _BYE JSON1 |
|
|
|
|
|
|
|
#define JSON_RESTART JSON1 _RESTART JSON1 |
|
|
|
|
|
|
|
#define JSON_CLOSE JSON3 |
|
|
|
#define JSON_CLOSE JSON3 |
|
|
|
#define JSON_MINESTATS JSON1 _MINESTATS JSON2 |
|
|
|
#define JSON_MINESTATS JSON1 _MINESTATS JSON2 |
|
|
|
#define JSON_CHECK JSON1 _CHECK JSON2 |
|
|
|
#define JSON_CHECK JSON1 _CHECK JSON2 |
|
|
@ -302,6 +300,8 @@ static const char *JSON_PARAMETER = "parameter"; |
|
|
|
#define MSG_ZERSUM 96 |
|
|
|
#define MSG_ZERSUM 96 |
|
|
|
#define MSG_ZERNOSUM 97 |
|
|
|
#define MSG_ZERNOSUM 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define MSG_BYE 0x101 |
|
|
|
|
|
|
|
|
|
|
|
#define MSG_INVNEG 121 |
|
|
|
#define MSG_INVNEG 121 |
|
|
|
#define MSG_SETQUOTA 122 |
|
|
|
#define MSG_SETQUOTA 122 |
|
|
|
#define MSG_LOCKOK 123 |
|
|
|
#define MSG_LOCKOK 123 |
|
|
@ -423,6 +423,7 @@ struct CODES { |
|
|
|
{ SEVERITY_SUCC, MSG_ZERNOSUM, PARAM_STR, "Zeroed %s stats without summary" }, |
|
|
|
{ SEVERITY_SUCC, MSG_ZERNOSUM, PARAM_STR, "Zeroed %s stats without summary" }, |
|
|
|
{ SEVERITY_SUCC, MSG_LOCKOK, PARAM_NONE, "Lock stats created" }, |
|
|
|
{ SEVERITY_SUCC, MSG_LOCKOK, PARAM_NONE, "Lock stats created" }, |
|
|
|
{ SEVERITY_WARN, MSG_LOCKDIS, PARAM_NONE, "Lock stats not enabled" }, |
|
|
|
{ SEVERITY_WARN, MSG_LOCKDIS, PARAM_NONE, "Lock stats not enabled" }, |
|
|
|
|
|
|
|
{ SEVERITY_SUCC, MSG_BYE, PARAM_STR, "%s" }, |
|
|
|
{ SEVERITY_FAIL, 0, (enum code_parameters)0, NULL } |
|
|
|
{ SEVERITY_FAIL, 0, (enum code_parameters)0, NULL } |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -545,12 +546,6 @@ static bool io_add(struct io_data *io_data, char *buf) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool io_put(struct io_data *io_data, char *buf) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
io_reinit(io_data); |
|
|
|
|
|
|
|
return io_add(io_data, buf); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void io_close(struct io_data *io_data) |
|
|
|
static void io_close(struct io_data *io_data) |
|
|
|
{ |
|
|
|
{ |
|
|
|
io_data->close = true; |
|
|
|
io_data->close = true; |
|
|
@ -2576,10 +2571,7 @@ static void gpuvddc(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __mayb |
|
|
|
|
|
|
|
|
|
|
|
void doquit(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group) |
|
|
|
void doquit(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (isjson) |
|
|
|
message(io_data, MSG_BYE, 0, _BYE, isjson); |
|
|
|
io_put(io_data, JSON_START JSON_BYE); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
io_put(io_data, _BYE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bye = true; |
|
|
|
bye = true; |
|
|
|
do_a_quit = true; |
|
|
|
do_a_quit = true; |
|
|
@ -2587,10 +2579,7 @@ void doquit(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused |
|
|
|
|
|
|
|
|
|
|
|
void dorestart(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group) |
|
|
|
void dorestart(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (isjson) |
|
|
|
message(io_data, MSG_BYE, 0, _RESTART, isjson); |
|
|
|
io_put(io_data, JSON_START JSON_RESTART); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
io_put(io_data, _RESTART); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bye = true; |
|
|
|
bye = true; |
|
|
|
do_a_restart = true; |
|
|
|
do_a_restart = true; |
|
|
|