Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3509968
D5536.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
D5536.diff
View Options
diff --git a/services/tunnelbroker/src/server/mod.rs b/services/tunnelbroker/src/server/mod.rs
--- a/services/tunnelbroker/src/server/mod.rs
+++ b/services/tunnelbroker/src/server/mod.rs
@@ -99,7 +99,7 @@
))
}
};
- let _session_item = match getSessionItem(&session_id) {
+ let session_item = match getSessionItem(&session_id) {
Ok(database_item) => database_item,
Err(err) => return Err(Status::unauthenticated(err.what())),
};
@@ -129,6 +129,28 @@
return Err(Status::internal(err.what()));
}
+ // Checking for an empty notif token and requesting the new one from the client
+ if session_item.notifyToken.is_empty()
+ && session_item.deviceType
+ == tunnelbroker::new_session_request::DeviceTypes::Mobile as i32
+ {
+ let result = tx_writer(
+ &session_id,
+ &tx,
+ Ok(tunnelbroker::MessageToClient {
+ data: Some(
+ tunnelbroker::message_to_client::Data::NewNotifyTokenRequired(()),
+ ),
+ }),
+ );
+ if let Err(err) = result.await {
+ debug!(
+ "Error while sending notification token request to the client: {}",
+ err
+ );
+ };
+ }
+
// Spawning asynchronous Tokio task with the client pinging loop inside to
// make sure that the client is online
tokio::spawn({
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 9:50 AM (12 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690743
Default Alt Text
D5536.diff (1 KB)
Attached To
Mode
D5536: [services] Tunnelbroker - Adding of requesting a new notification token if empty
Attached
Detach File
Event Timeline
Log In to Comment