Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3500748
D6771.id23130.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.id23130.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
Sat, Dec 21, 2:41 AM (17 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682622
Default Alt Text
D6771.id23130.diff (1 KB)
Attached To
Mode
D6771: [keyserver] Adding metadata to the Tunnelbroker client constructor
Attached
Detach File
Event Timeline
Log In to Comment