1
0
mirror of https://gitee.com/willfree/mlsr.git synced 2026-06-03 15:56:13 +08:00

名称前缀表:增加、删除缓存池表项

This commit is contained in:
free will
2022-06-15 16:28:22 +08:00
parent 245e1f0e9a
commit 8d52bcf7fc
+9 -2
View File
@@ -352,7 +352,8 @@ func (t *NamePrefixTable) UpdateWithNewRoute(entries []*RoutingTableEntry) {
// @return *RoutingTablePoolEntry
//
func (t *NamePrefixTable) AddRtpeToPool(rtpe *RoutingTablePoolEntry) *RoutingTablePoolEntry {
t.m_rtpool[rtpe.GetDestination().ToUri()] = rtpe
return rtpe
}
//
@@ -362,5 +363,11 @@ func (t *NamePrefixTable) AddRtpeToPool(rtpe *RoutingTablePoolEntry) *RoutingTab
// @param rtpe
//
func (t *NamePrefixTable) DeleteRtpeFromPool(rtpe *RoutingTablePoolEntry) {
// 查看是否有该条目
_, ok := t.m_rtpool[rtpe.GetDestination().ToUri()]
if !ok {
common2.LogDebug("Attempted to delete non-existent origin: " +
rtpe.GetDestination().ToUri() + " from NPT routing table entry storage pool.")
}
delete(t.m_rtpool, rtpe.GetDestination().ToUri())
}