skipping send_to_all if invalid syntax was sent

This commit is contained in:
Václav Šmejkal 2023-03-31 17:50:40 +02:00
parent 4b481d71ca
commit af03d64699
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -146,6 +146,8 @@ void *send_to_all(void *json)
//PARSE
struct json_object *json_obj = json_tokener_parse((char*) json);
if (json_obj == NULL) return; //EXIT IF INVALID SYNTAX WAS SENT
do //SEND TO ALL CONNECTIONS
{
why2_send_socket(get_string_from_json(json_obj, "message"), get_string_from_json(json_obj, "username"), node_buffer -> connection); //SEND TO CLIENT