Page MenuHomePhabricator

D4100.id13241.diff
No OneTemporary

D4100.id13241.diff

diff --git a/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.h b/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.h
--- a/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.h
+++ b/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.h
@@ -27,6 +27,7 @@
bool isEmpty(const std::string deviceID);
DeliveryBrokerMessage pop(const std::string deviceID);
void erase(const std::string deviceID);
+ void deleteQueueIfEmpty(const std::string clientDeviceID);
};
} // namespace network
diff --git a/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.cpp b/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.cpp
--- a/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.cpp
+++ b/services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.cpp
@@ -66,5 +66,11 @@
this->messagesMap.erase(deviceID);
};
+void DeliveryBroker::deleteQueueIfEmpty(const std::string clientDeviceID) {
+ if (DeliveryBroker::getInstance().isEmpty(clientDeviceID)) {
+ DeliveryBroker::getInstance().erase(clientDeviceID);
+ }
+};
+
} // namespace network
} // namespace comm

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 9:03 AM (20 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2604494
Default Alt Text
D4100.id13241.diff (1 KB)

Event Timeline