Skip to content

Commit

Permalink
server/netget.c: do not actually report a STRING:N value so far [netw…
Browse files Browse the repository at this point in the history
…orkupstools#266]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 23, 2024
1 parent a47ceb5 commit 3e5d04e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/netget.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ static void get_type(nut_ctype_t *client, const char *upsname, const char *var)
}
}

#if DEBUG
/* Need to figure out an "aux" value here (length of current
* string at least?) and propagate the flag into where netset
* would see it. Maybe this sanity-check should move into the
* core state.c logic, so dstate setting would already remember
* the defaulted flag (and maybe set another to clarify it is
* a guess). Currently that code does not concern itself with
* sanity-checks, it seems!
*/
if (!ok && !(node->flags & ST_FLAG_NUMBER)) {
upsdebugx(3, "%s: assuming UPS[%s] variable %s is a STRING after all, by contents; "
"value='%s' len='%" PRIuSIZE "' aux='%ld'",
Expand All @@ -213,6 +222,7 @@ static void get_type(nut_ctype_t *client, const char *upsname, const char *var)
sendback(client, "%s STRING:%ld\n", buf, node->aux);
return;
}
#endif

if (!ok) {
/* FIXME: Should this return an error?
Expand Down

0 comments on commit 3e5d04e

Please sign in to comment.