Browse Source

api.c all STATUS messages automatically escaped

nfactor-troky
Kano 12 years ago
parent
commit
ade940bcba
  1. 14
      api.c

14
api.c

@ -496,7 +496,7 @@ struct CODES { @@ -496,7 +496,7 @@ struct CODES {
{ SEVERITY_INFO, MSG_PGALRDIS,PARAM_PGA, "PGA %d already disabled" },
{ SEVERITY_INFO, MSG_PGAENA, PARAM_PGA, "PGA %d sent enable message" },
{ 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
#ifdef WANT_CPUMINE
{ SEVERITY_ERR, MSG_CPUNON, PARAM_NONE, "No CPUs" },
@ -564,8 +564,8 @@ struct CODES { @@ -564,8 +564,8 @@ struct CODES {
{ SEVERITY_SUCC, MSG_SETCONFIG,PARAM_SET, "Set config '%s' to %d" },
{ 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_CONPAR, PARAM_NONE, "Missing config parameters 'name\\,N'" },
{ SEVERITY_ERR, MSG_CONVAL, PARAM_STR, "Missing config value N for '%s\\,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_FAIL, 0, 0, NULL }
};
@ -1189,8 +1189,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson) @@ -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_time(root, "When", &when, false);
root = api_add_int(root, "Code", &messageid, false);
root = api_add_string(root, "Msg", buf, false);
root = api_add_string(root, "Description", opt_api_description, false);
root = api_add_escape(root, "Msg", buf, false);
root = api_add_escape(root, "Description", opt_api_description, false);
root = print_data(root, ptr, isjson);
if (isjson)
@ -1204,8 +1204,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson) @@ -1204,8 +1204,8 @@ static char *message(int messageid, int paramid, char *param2, bool isjson)
int id = -1;
root = api_add_int(root, "Code", &id, false);
sprintf(buf, "%d", messageid);
root = api_add_string(root, "Msg", buf, false);
root = api_add_string(root, "Description", opt_api_description, false);
root = api_add_escape(root, "Msg", buf, false);
root = api_add_escape(root, "Description", opt_api_description, false);
root = print_data(root, ptr, isjson);
if (isjson)

Loading…
Cancel
Save