From 36e4f31e8725decfc8d9e934b72a4924c355f414 Mon Sep 17 00:00:00 2001 From: doublecouponday Date: Sat, 22 Jan 2022 17:50:14 +1300 Subject: [PATCH] chore: launch and new auth check --- .vscode/launch.json | 2 +- src/client.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8f8594c..9b55058 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -33,7 +33,7 @@ "stopAtEntry": false, "cwd": "${fileDirname}", "environment": [], - "console": "externalTerminal" + "console": "integratedTerminal" } ] diff --git a/src/client.cpp b/src/client.cpp index 9615bb2..a16397f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -54,6 +54,9 @@ client_auth_kit::client_auth_kit(client_init_kit& init_kit, const char* data, in EXECUTION_STATUS process_auth(const Message& mess, std::unique_ptr& socket, int my_auth) { + if (mess == Message::null_message) + return EXECUTION_STATUS::FAILED; + const char* data = mess.Data.data(); size_t data_len = mess.Length; int i = 0; @@ -132,7 +135,7 @@ bool check_for_auth_connection(client_init_kit& init_kit, client_auth_kit& auth_ if (status == ConnectionStatus::SUCCESS) { std::cout << "Public Connection has connected, now authenticating" << std::endl; - auth_kit.unauthed_sockets.emplace_back(std::make_unique(std::move(auth_kit.public_connector))); + auth_kit.unauthed_sockets.emplace_back(std::make_unique(std::move(auth_kit.public_connector))); //add to the list of connected sockets ready to complete authentication if (init_kit.is_leader) auth_kit.unauthed_sockets.back()->send_data(create_message(MESSAGE_TYPE::AUTH_PLS));