Skip to content

Commit 603c3de

Browse files
desistudrdeago
authored andcommitted
Update EndPointListener.cs
1 parent 2210619 commit 603c3de

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/EmbedIO/Net/Internal/EndPointListener.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,19 @@ public void RemovePrefix(ListenerPrefix prefix)
170170
do
171171
{
172172
prefs = _prefixes;
173-
if (!prefs.ContainsKey(prefix))
173+
ListenerPrefix lpKey = null;
174+
foreach (var p in _prefixes.Keys)
175+
if (p.Path == prefix.Path)
176+
{
177+
lpKey = p;
178+
break;
179+
}
180+
181+
if (lpKey is null)
174182
break;
175183

176184
p2 = prefs.ToDictionary(x => x.Key, x => x.Value);
177-
p2.Remove(prefix);
185+
p2.Remove(lpKey);
178186
}
179187
while (Interlocked.CompareExchange(ref _prefixes, p2, prefs) != prefs);
180188

@@ -378,4 +386,4 @@ private void CheckIfRemove()
378386
EndPointManager.RemoveEndPoint(this, _endpoint);
379387
}
380388
}
381-
}
389+
}

0 commit comments

Comments
 (0)