From 25fde956a2010a91c0f21fc0517e8b2695b432d7 Mon Sep 17 00:00:00 2001 From: Peter LeVasseur Date: Fri, 9 Aug 2024 15:00:14 -0400 Subject: [PATCH 1/4] Fix workflow triggers to fire on any source change --- .github/workflows/bundled-lint-and-test.yaml | 5 +++-- .github/workflows/unbundled-lint-and-test.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bundled-lint-and-test.yaml b/.github/workflows/bundled-lint-and-test.yaml index 5f310491..aea0feeb 100644 --- a/.github/workflows/bundled-lint-and-test.yaml +++ b/.github/workflows/bundled-lint-and-test.yaml @@ -23,8 +23,9 @@ on: branches: [ main ] pull_request: paths: - - "src/**" - - "Cargo.*" + - ".github/**" + - "**/src/**" + - "**/Cargo.*" workflow_call: workflow_dispatch: diff --git a/.github/workflows/unbundled-lint-and-test.yaml b/.github/workflows/unbundled-lint-and-test.yaml index aec25979..c1f5499e 100644 --- a/.github/workflows/unbundled-lint-and-test.yaml +++ b/.github/workflows/unbundled-lint-and-test.yaml @@ -27,8 +27,9 @@ on: branches: [ main ] pull_request: paths: - - "src/**" - - "Cargo.*" + - ".github/**" + - "**/src/**" + - "**/Cargo.*" workflow_call: workflow_dispatch: From 36fa7c5cc5ba4b015c5a4d3ea0086e4e57352dd6 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Thu, 8 Aug 2024 14:19:53 -0400 Subject: [PATCH 2/4] Add check for shared mem payload type --- up-streamer/src/ustreamer.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/up-streamer/src/ustreamer.rs b/up-streamer/src/ustreamer.rs index 0655a33f..3764ef81 100644 --- a/up-streamer/src/ustreamer.rs +++ b/up-streamer/src/ustreamer.rs @@ -712,6 +712,18 @@ impl UListener for ForwardingListener { FORWARDING_LISTENER_FN_ON_RECEIVE_TAG, &msg ); + + if msg.attributes.payload_format.enum_value_or_default() == up_rust::UPayloadFormat::UPAYLOAD_FORMAT_SHM { + debug!( + "{}:{}:{} Received message with type UPAYLOAD_FORMAT_SHM, which is not supported: {:#?}", + self.forwarding_id, + FORWARDING_LISTENER_TAG, + FORWARDING_LISTENER_FN_ON_RECEIVE_TAG, + &msg.attributes + ); + return; + } + if let Err(e) = self.sender.send(Arc::new(msg)).await { error!( "{}:{}:{} Unable to send message to worker pool: {e:?}", From 05aaff774dcd541e58b920778af37a585fa5a46a Mon Sep 17 00:00:00 2001 From: brianeaton Date: Fri, 9 Aug 2024 14:46:58 -0400 Subject: [PATCH 3/4] Update up-streamer/src/ustreamer.rs Co-authored-by: Pete LeVasseur --- up-streamer/src/ustreamer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up-streamer/src/ustreamer.rs b/up-streamer/src/ustreamer.rs index 3764ef81..69514192 100644 --- a/up-streamer/src/ustreamer.rs +++ b/up-streamer/src/ustreamer.rs @@ -715,7 +715,7 @@ impl UListener for ForwardingListener { if msg.attributes.payload_format.enum_value_or_default() == up_rust::UPayloadFormat::UPAYLOAD_FORMAT_SHM { debug!( - "{}:{}:{} Received message with type UPAYLOAD_FORMAT_SHM, which is not supported: {:#?}", + "{}:{}:{} Received message with type UPAYLOAD_FORMAT_SHM, which is not supported. A pointer to shared memory will not be usable on another device. UAttributes: {:#?}", self.forwarding_id, FORWARDING_LISTENER_TAG, FORWARDING_LISTENER_FN_ON_RECEIVE_TAG, From 696cf1d33df5b0380172d3c54cf99fdab50422cc Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Fri, 9 Aug 2024 14:50:17 -0400 Subject: [PATCH 4/4] Incorporate Pete's suggestions --- up-streamer/src/ustreamer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/up-streamer/src/ustreamer.rs b/up-streamer/src/ustreamer.rs index 69514192..7135ad61 100644 --- a/up-streamer/src/ustreamer.rs +++ b/up-streamer/src/ustreamer.rs @@ -21,7 +21,7 @@ use std::collections::{HashMap, HashSet}; use std::hash::{Hash, Hasher}; use std::ops::Deref; use std::thread; -use up_rust::{UCode, UListener, UMessage, UStatus, UTransport, UUIDBuilder, UUri}; +use up_rust::{UCode, UListener, UMessage, UPayloadFormat, UStatus, UTransport, UUIDBuilder, UUri}; const USTREAMER_TAG: &str = "UStreamer:"; const USTREAMER_FN_NEW_TAG: &str = "new():"; @@ -713,7 +713,7 @@ impl UListener for ForwardingListener { &msg ); - if msg.attributes.payload_format.enum_value_or_default() == up_rust::UPayloadFormat::UPAYLOAD_FORMAT_SHM { + if msg.attributes.payload_format.enum_value_or_default() == UPayloadFormat::UPAYLOAD_FORMAT_SHM { debug!( "{}:{}:{} Received message with type UPAYLOAD_FORMAT_SHM, which is not supported. A pointer to shared memory will not be usable on another device. UAttributes: {:#?}", self.forwarding_id,