| 712 | return connection; |
| 713 | } |
| 714 | void CacheConnection(const TIntrusivePtr<IConnection>& connection) const { |
| 715 | const TUdpAddress& addr = connection->GetAddress(); |
| 716 | const TConnectionSettings& connectionSettings = connection->GetSettings(); |
| 717 | |
| 718 | TConnectionsCache::iterator c = Find(ConnectionsCache, addr, connectionSettings); |
| 719 | if (c != ConnectionsCache.end()) { |
| 720 | c->second = connection; // they are equal or we overwrite old connection |
| 721 | Y_ASSERT(Find(OldConnectionsCache, addr, connectionSettings) == OldConnectionsCache.end()); |
| 722 | return; |
| 723 | } |
| 724 | |
| 725 | c = Find(OldConnectionsCache, addr, connectionSettings); |
| 726 | if (c != OldConnectionsCache.end()) { |
| 727 | OldConnectionsCache.erase(c); |
| 728 | } |
| 729 | |
| 730 | ConnectionsCache.insert(std::make_pair(addr, connection)); |
| 731 | } |
| 732 | void Step() { |
| 733 | { |
| 734 | TGuard<TSpinLock> lock(CS); |
nothing calls this directly
no test coverage detected