mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
api.c all STATUS messages automatically escaped
This commit is contained in:
parent
fd2fa260c7
commit
ade940bcba
14
api.c
14
api.c
@ -496,7 +496,7 @@ struct CODES {
|
|||||||
{ SEVERITY_INFO, MSG_PGALRDIS,PARAM_PGA, "PGA %d already disabled" },
|
{ SEVERITY_INFO, MSG_PGALRDIS,PARAM_PGA, "PGA %d already disabled" },
|
||||||
{ SEVERITY_INFO, MSG_PGAENA, PARAM_PGA, "PGA %d sent enable message" },
|
{ SEVERITY_INFO, MSG_PGAENA, PARAM_PGA, "PGA %d sent enable message" },
|
||||||
{ SEVERITY_INFO, MSG_PGADIS, PARAM_PGA, "PGA %d set disable flag" },
|
{ SEVERITY_INFO, MSG_PGADIS, PARAM_PGA, "PGA %d set disable flag" },
|
||||||
{ SEVERITY_ERR, MSG_PGAUNW, PARAM_PGA, "PGA %d is not flagged WELL\\, cannot enable" },
|
{ SEVERITY_ERR, MSG_PGAUNW, PARAM_PGA, "PGA %d is not flagged WELL, cannot enable" },
|
||||||
#endif
|
#endif
|
||||||
#ifdef WANT_CPUMINE
|
#ifdef WANT_CPUMINE
|
||||||
{ SEVERITY_ERR, MSG_CPUNON, PARAM_NONE, "No CPUs" },
|
{ SEVERITY_ERR, MSG_CPUNON, PARAM_NONE, "No CPUs" },
|
||||||
@ -564,8 +564,8 @@ struct CODES {
|
|||||||
{ SEVERITY_SUCC, MSG_SETCONFIG,PARAM_SET, "Set config '%s' to %d" },
|
{ SEVERITY_SUCC, MSG_SETCONFIG,PARAM_SET, "Set config '%s' to %d" },
|
||||||
{ SEVERITY_ERR, MSG_UNKCON, PARAM_STR, "Unknown config '%s'" },
|
{ SEVERITY_ERR, MSG_UNKCON, PARAM_STR, "Unknown config '%s'" },
|
||||||
{ SEVERITY_ERR, MSG_INVNUM, PARAM_BOTH, "Invalid number (%d) for '%s' range is 0-9999" },
|
{ SEVERITY_ERR, MSG_INVNUM, PARAM_BOTH, "Invalid number (%d) for '%s' range is 0-9999" },
|
||||||
{ SEVERITY_ERR, MSG_CONPAR, PARAM_NONE, "Missing config parameters 'name\\,N'" },
|
{ SEVERITY_ERR, MSG_CONPAR, PARAM_NONE, "Missing config parameters 'name,N'" },
|
||||||
{ SEVERITY_ERR, MSG_CONVAL, PARAM_STR, "Missing config value N for '%s\\,N'" },
|
{ SEVERITY_ERR, MSG_CONVAL, PARAM_STR, "Missing config value N for '%s,N'" },
|
||||||
{ SEVERITY_FAIL, 0, 0, NULL }
|
{ SEVERITY_FAIL, 0, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1189,8 +1189,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson)
|
|||||||
root = api_add_string(root, _STATUS, severity, false);
|
root = api_add_string(root, _STATUS, severity, false);
|
||||||
root = api_add_time(root, "When", &when, false);
|
root = api_add_time(root, "When", &when, false);
|
||||||
root = api_add_int(root, "Code", &messageid, false);
|
root = api_add_int(root, "Code", &messageid, false);
|
||||||
root = api_add_string(root, "Msg", buf, false);
|
root = api_add_escape(root, "Msg", buf, false);
|
||||||
root = api_add_string(root, "Description", opt_api_description, false);
|
root = api_add_escape(root, "Description", opt_api_description, false);
|
||||||
|
|
||||||
root = print_data(root, ptr, isjson);
|
root = print_data(root, ptr, isjson);
|
||||||
if (isjson)
|
if (isjson)
|
||||||
@ -1204,8 +1204,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson)
|
|||||||
int id = -1;
|
int id = -1;
|
||||||
root = api_add_int(root, "Code", &id, false);
|
root = api_add_int(root, "Code", &id, false);
|
||||||
sprintf(buf, "%d", messageid);
|
sprintf(buf, "%d", messageid);
|
||||||
root = api_add_string(root, "Msg", buf, false);
|
root = api_add_escape(root, "Msg", buf, false);
|
||||||
root = api_add_string(root, "Description", opt_api_description, false);
|
root = api_add_escape(root, "Description", opt_api_description, false);
|
||||||
|
|
||||||
root = print_data(root, ptr, isjson);
|
root = print_data(root, ptr, isjson);
|
||||||
if (isjson)
|
if (isjson)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user