From 2c4bc3ea12b498fbff3b6df486eb1ab3ac3640e7 Mon Sep 17 00:00:00 2001 From: Brain Date: Thu, 28 Sep 2023 19:31:18 +0100 Subject: [PATCH 1/4] Update wsclient.cpp --- src/dpp/wsclient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dpp/wsclient.cpp b/src/dpp/wsclient.cpp index f7b90ece5f..ce44082bea 100644 --- a/src/dpp/wsclient.cpp +++ b/src/dpp/wsclient.cpp @@ -38,11 +38,12 @@ constexpr size_t MAXHEADERSIZE = sizeof(uint64_t) + 2; websocket_client::websocket_client(const std::string &hostname, const std::string &port, const std::string &urlpath, ws_opcode opcode) : ssl_client(hostname, port), - key(std::to_string(time(nullptr))), state(HTTP_HEADERS), path(urlpath), data_opcode(opcode) { + key = std::to_string(time(nullptr)); + key = base64_encode(key.c_str(), key.length()); } void websocket_client::connect() From a96a6f1c85ad0222aa628ce0abda5a5723597c48 Mon Sep 17 00:00:00 2001 From: Brain Date: Thu, 28 Sep 2023 19:47:24 +0100 Subject: [PATCH 2/4] Update wsclient.cpp --- src/dpp/wsclient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dpp/wsclient.cpp b/src/dpp/wsclient.cpp index ce44082bea..c01ac04a8b 100644 --- a/src/dpp/wsclient.cpp +++ b/src/dpp/wsclient.cpp @@ -25,6 +25,7 @@ #include #include #include +#include namespace dpp { From b68bfa403ecce58b00fd0aee33ed5ff86d47c4ad Mon Sep 17 00:00:00 2001 From: Brain Date: Thu, 28 Sep 2023 20:07:01 +0100 Subject: [PATCH 3/4] Update wsclient.cpp --- src/dpp/wsclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dpp/wsclient.cpp b/src/dpp/wsclient.cpp index c01ac04a8b..6e6610e0f4 100644 --- a/src/dpp/wsclient.cpp +++ b/src/dpp/wsclient.cpp @@ -44,7 +44,7 @@ websocket_client::websocket_client(const std::string &hostname, const std::strin data_opcode(opcode) { key = std::to_string(time(nullptr)); - key = base64_encode(key.c_str(), key.length()); + key = base64_encode((const unsigned char*)key.c_str(), key.length()); } void websocket_client::connect() From 99145bdbc6a7cacded26bb465da1baa125bc2a3d Mon Sep 17 00:00:00 2001 From: Brain Date: Thu, 28 Sep 2023 20:59:56 +0100 Subject: [PATCH 4/4] Update wsclient.cpp [skip ci] --- src/dpp/wsclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dpp/wsclient.cpp b/src/dpp/wsclient.cpp index 6e6610e0f4..aa9c657240 100644 --- a/src/dpp/wsclient.cpp +++ b/src/dpp/wsclient.cpp @@ -44,7 +44,7 @@ websocket_client::websocket_client(const std::string &hostname, const std::strin data_opcode(opcode) { key = std::to_string(time(nullptr)); - key = base64_encode((const unsigned char*)key.c_str(), key.length()); + key = base64_encode(reinterpret_cast(key.c_str()), key.length()); } void websocket_client::connect()