Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed May 31, 2024
2 parents 2b152af + 2244d0d commit 7f888d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,10 @@ class DefaultResolver : public Resolver {

void discard_cache(std::string_view host, IPAddr ip) override {
auto ipaddr = dnscache_.borrow(host);
if (ip.undefined() || ipaddr->empty()) ipaddr.recycle(true);
else {
if (ip.undefined() || ipaddr->empty()) {
ipaddr->delete_all();
ipaddr.recycle(true);
} else {
for (auto itr = ipaddr->rbegin(); itr != ipaddr->rend(); itr++) {
if ((*itr)->addr == ip) {
ipaddr->erase(*itr);
Expand Down

0 comments on commit 7f888d2

Please sign in to comment.