MCPcopy Create free account
hub / github.com/attermann/microReticulum / deregister_request_handler

Method deregister_request_handler

src/microReticulum/Destination.cpp:391–401  ·  view source on GitHub ↗

Deregisters a request handler. :param path: The path for the request handler to be deregistered. :returns: True if the handler was deregistered, otherwise False. */

Source from the content-addressed store, hash-verified

389:returns: True if the handler was deregistered, otherwise False.
390*/
391bool Destination::deregister_request_handler(const Bytes& path) {
392 assert(_object);
393 Bytes path_hash(Identity::truncated_hash(path));
394 //auto handler_iter = _object->_request_handlers.find(path_hash);
395 //if (handler_iter != _object->_request_handlers.end()) {
396 // _object->_request_handlers.erase(path_hash);
397 // return true;
398 //}
399 //return false;
400 return (_object->_request_handlers.erase(path_hash) > 0);
401}
402
403void Destination::receive(const Packet& packet) {
404 assert(_object);

Callers

nothing calls this directly

Calls 1

eraseMethod · 0.80

Tested by

no test coverage detected