From ceb14951ddb7c8d6065d2715884caf49f528e0d3 Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:07:13 +0200 Subject: [PATCH 1/4] [Actions] Updating the Ubuntu version on a test workflow to match the other ones (#1629) * Building Thunder with GCC 11 before tests * Adding a installation of GCC 11.4 * Specifying a different version since 11.4 cannot be found * Using latest ubuntu like in the build workflow instead of installing new gcc * Branch restriction for test build --- .github/workflows/Test Thunder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Test Thunder.yml b/.github/workflows/Test Thunder.yml index e0bc47040..1e831f9df 100644 --- a/.github/workflows/Test Thunder.yml +++ b/.github/workflows/Test Thunder.yml @@ -17,7 +17,7 @@ on: jobs: Thunder: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: From e0d062d6d145c2fcd72670ebb41e3a892a47c7fa Mon Sep 17 00:00:00 2001 From: MFransen69 <39826971+MFransen69@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:09:52 +0200 Subject: [PATCH 2/4] [websocket] fix cornercase when header is at end of read buffer (#1632) --- Source/websocket/WebSocketLink.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/websocket/WebSocketLink.h b/Source/websocket/WebSocketLink.h index 728cf73ec..81b787c3e 100644 --- a/Source/websocket/WebSocketLink.h +++ b/Source/websocket/WebSocketLink.h @@ -646,7 +646,9 @@ POP_WARNING() result += static_cast(headerSize + payloadSizeInControlFrame); // actualDataSize } else { - _parent.ReceiveData(&(dataFrame[result + headerSize]), actualDataSize); + if (actualDataSize != 0) { + _parent.ReceiveData(&(dataFrame[result + headerSize]), actualDataSize); + } result += (headerSize + actualDataSize); } From ac3238a429e27b16831a989157a5a0428ef9a6eb Mon Sep 17 00:00:00 2001 From: sebaszm <45654185+sebaszm@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:19:51 +0200 Subject: [PATCH 3/4] [JSON] Assign from OptionalType (#1631) Co-authored-by: Pierre Wielders --- Source/core/JSON.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Source/core/JSON.h b/Source/core/JSON.h index d445e0842..4153a9f29 100644 --- a/Source/core/JSON.h +++ b/Source/core/JSON.h @@ -532,6 +532,15 @@ namespace Core { return (*this); } + NumberType& operator=(const Core::OptionalType& RHS) + { + if (RHS.IsSet() == true) { + operator=(RHS.Value()); + } + + return (*this); + } + inline TYPE Default() const { return _default; @@ -1054,6 +1063,15 @@ namespace Core { return (*this); } + FloatType& operator=(const Core::OptionalType& RHS) + { + if (RHS.IsSet() == true) { + operator=(RHS.Value()); + } + + return (*this); + } + inline TYPE Default() const { return _default; @@ -1347,6 +1365,15 @@ namespace Core { return (*this); } + Boolean& operator=(const Core::OptionalType& RHS) + { + if (RHS.IsSet() == true) { + operator=(RHS.Value()); + } + + return (*this); + } + inline bool Value() const { return ((_value & SetBit) != 0 ? (_value & ValueBit) != 0 : (_value & DefaultBit) != 0); @@ -1582,6 +1609,15 @@ namespace Core { return (*this); } + String& operator=(const Core::OptionalType& RHS) + { + if (RHS.IsSet() == true) { + operator=(RHS.Value()); + } + + return (*this); + } + String& operator=(const char RHS[]) { Core::ToString(RHS, _value); @@ -2630,6 +2666,15 @@ namespace Core { return (*this); } + EnumType& operator=(const Core::OptionalType& RHS) + { + if (RHS.IsSet() == true) { + operator=(RHS.Value()); + } + + return (*this); + } + inline const ENUMERATE Default() const { return (_default); @@ -3243,6 +3288,16 @@ namespace Core { return (*this); } + template + ArrayType& operator=(const Core::OptionalType& RHS) + { + if (RHS.IsSet() == true) { + operator=(RHS.Value()); + } + + return (*this); + } + template>::value, int>::type = 0> inline operator const ENUM() const { From eb2518140047c4148c292649f80931f41f106cf6 Mon Sep 17 00:00:00 2001 From: Pierre Wielders Date: Fri, 7 Jun 2024 17:18:21 +0200 Subject: [PATCH 4/4] Fix the Clone functionality, seems it is used ;-) (#1633) --- Source/Thunder/PluginServer.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Thunder/PluginServer.h b/Source/Thunder/PluginServer.h index 73cbaf6f0..3f57027a3 100644 --- a/Source/Thunder/PluginServer.h +++ b/Source/Thunder/PluginServer.h @@ -2923,13 +2923,12 @@ namespace PluginHost { if ((original.IsValid() == true) && (_services.find(newCallsign) == _services.end())) { // Copy original configuration - Plugin::Config newConfiguration; - newConfiguration.FromString(original->ConfigLine()); + Plugin::Config newConfiguration(original->Configuration()); newConfiguration.Callsign = newCallsign; Core::ProxyType clone = Core::ProxyType::Create(Configuration(), newConfiguration, *this, Service::mode::CLONED, _engine); - if (newService.IsValid() == true) { + if (clone.IsValid() == true) { // Fire up the interface. Let it handle the messages. _services.emplace( std::piecewise_construct,