From 68c7bef33e74f23aa0136ccd6f7faa654d671ebc Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 21 五月 2021 09:23:01 +0800 Subject: [PATCH] center publish notify; fix topic partial match. --- box/center.cpp | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/box/center.cpp b/box/center.cpp index e745be8..3f565b1 100644 --- a/box/center.cpp +++ b/box/center.cpp @@ -124,20 +124,14 @@ } else { replyer(MakeReply(eSuccess)); if (clients.empty()) { return; } - - auto it = clients.begin(); - do { - auto &cli = *it; + for (auto &cli : clients) { auto node = cli.weak_node_.lock(); if (node) { // should also make sure that mq is not killed before msg expires. // it would be ok if (kill_time - offline_time) is longer than expire time. socket.Send({cli.mq_id_, cli.mq_abs_addr_}, msg); - ++it; - } else { - it = clients.erase(it); } - } while (it != clients.end()); + } } }; switch (head.type()) { -- Gitblit v1.8.0