refresh: update client login status from "status" field value

Update the session status based on the value of the "status" field
in the refresh response, the possible values are:
LINUXS, LINUX, WINS, WIN.
master
Alejandro Sirgo Rica 2024-11-18 10:09:08 +01:00
parent 4103945785
commit 16baa88541
1 changed files with 5 additions and 1 deletions

View File

@ -849,8 +849,12 @@ static int og_resp_refresh(json_t *data, struct og_client *cli)
* client using linux/windows mode.
*/
if (status) {
if (!strncmp(status, "LINUX", strlen("LINUX"))) {
if (!strncmp(status, "LINUXS", strlen("LINUXS"))) {
cli->status = OG_CLIENT_STATUS_LINUX_SESSION;
} else if (!strncmp(status, "LINUX", strlen("LINUX"))) {
cli->status = OG_CLIENT_STATUS_LINUX;
} else if (!strncmp(status, "WINS", strlen("WINS"))) {
cli->status = OG_CLIENT_STATUS_WIN_SESSION;
} else if (!strncmp(status, "WIN", strlen("WIN"))) {
cli->status = OG_CLIENT_STATUS_WIN;
}