Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3497671
D6771.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6771.diff
View Options
diff --git a/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs b/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
--- a/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
+++ b/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
@@ -26,7 +26,10 @@
#[napi]
impl TunnelbrokerClient {
#[napi(constructor)]
- pub fn new(on_receive_callback: ThreadsafeFunction<String>) -> Self {
+ pub fn new(
+ device_id: String,
+ on_receive_callback: ThreadsafeFunction<String>,
+ ) -> Self {
let mut client =
tunnelbroker::initialize_client(TUNNELBROKER_SERVICE_ADDR.to_string());
let (tx, rx) = mpsc::channel(1);
@@ -36,8 +39,13 @@
// and calling the callback function with the received payload
tunnelbroker::RUNTIME.spawn({
async move {
+ let mut request = Request::new(stream);
+ request.metadata_mut().insert(
+ "deviceid",
+ device_id.parse().expect("Failed to parse deviceID"),
+ );
let response = client
- .messages_stream(Request::new(stream))
+ .messages_stream(request)
.await
.expect("Failed to receive messages stream from Tunnelbroker");
let mut resp_stream = response.into_inner();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 7:44 PM (16 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682622
Default Alt Text
D6771.diff (1 KB)
Attached To
Mode
D6771: [keyserver] Adding metadata to the Tunnelbroker client constructor
Attached
Detach File
Event Timeline
Log In to Comment