Skip to content

Commit

Permalink
mumble: prevent rejected clients from crashing a future connecting cl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
blattersturm committed Feb 15, 2019
1 parent db6cd33 commit a29aa79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/components/voip-server-mumble/src/messagehandler.cpp
Expand Up @@ -140,8 +140,6 @@ void Mh_handle_message(client_t *client, message_t *msg)
goto disconnect;
}*/

client->authenticated = true;

client_itr = NULL;
while (Client_iterate(&client_itr) != NULL) {
if (!IS_AUTH(client_itr))
Expand Down Expand Up @@ -182,6 +180,8 @@ void Mh_handle_message(client_t *client, message_t *msg)
goto disconnect;
}

client->authenticated = true;

/* Name */
client->username = strdup(msg->payload.authenticate->username().c_str());

Expand Down
6 changes: 6 additions & 0 deletions code/components/voip-server-mumble/src/server.cpp
Expand Up @@ -420,6 +420,12 @@ static InitFunction initFunction([]()
client->rxcount = client->msgsize = 0;
}
}

// close stream if shutting down
if (client->shutdown_wait)
{
client->stream->Close();
}
});

stream->SetCloseCallback([=]()
Expand Down

0 comments on commit a29aa79

Please sign in to comment.