Page MenuHomePhabricator

D5207.id17029.diff
No OneTemporary

D5207.id17029.diff

diff --git a/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp b/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp
--- a/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp
+++ b/services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.cpp
@@ -182,6 +182,7 @@
"No such session found. SessionID: " + sessionID);
}
+ tunnelbroker::GetResponse response;
// Handling of device notification token expiration and update
if (request->has_newnotifytoken() &&
!database::DatabaseManager::getInstance().updateSessionItemDeviceToken(
@@ -189,6 +190,12 @@
return grpc::Status(
grpc::StatusCode::INTERNAL,
"Can't update device token in the database");
+ } else if (sessionItem->getNotifyToken().empty()) {
+ response.mutable_newnotifytokenrequired();
+ if (!writer->Write(response)) {
+ throw std::runtime_error(
+ "gRPC writer error on sending data to the client");
+ }
}
const std::string clientDeviceID = sessionItem->getDeviceID();
@@ -204,7 +211,7 @@
// DeliveryBroker.
DeliveryBroker::getInstance().erase(clientDeviceID);
}
- tunnelbroker::GetResponse response;
+
auto respondToWriter =
[&writer, &response](std::string fromDeviceID, std::string payload) {
response.mutable_responsemessage()->set_fromdeviceid(fromDeviceID);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 8:35 PM (19 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577248
Default Alt Text
D5207.id17029.diff (1 KB)

Event Timeline