returing code from why2_listen_authority

This commit is contained in:
Václav Šmejkal 2025-02-01 18:07:13 +01:00
parent bd986f5327
commit 7377b672bf
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -1229,8 +1229,11 @@ void *why2_listen_authority(void *socket)
int socket_ptr = *(int*) socket; int socket_ptr = *(int*) socket;
char *read; char *read;
why2_bool exiting = 0; why2_bool exiting = 0;
why2_bool *success = why2_malloc(sizeof(why2_bool));
char *code; char *code;
*success = 0;
do do
{ {
//READ PACKET //READ PACKET
@ -1286,15 +1289,20 @@ void *why2_listen_authority(void *socket)
{ {
why2_toml_read_free(username); why2_toml_read_free(username);
} }
} else exiting = 1; } else
} else exiting = 1; {
//EXIT
*success = strcmp(code, WHY2_CHAT_CODE_SUCCESS) == 0;
exiting = 1;
}
}
//DEALLOCATION //DEALLOCATION
why2_deallocate(read); why2_deallocate(read);
why2_deallocate(code); why2_deallocate(code);
} while (!exiting); } while (!exiting);
return NULL; return success;
} }
void *why2_getline_thread(WHY2_UNUSED void* arg) void *why2_getline_thread(WHY2_UNUSED void* arg)