Skip to content

Commit

Permalink
fix subscription overriding (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbandikatla authored Apr 26, 2024
1 parent 02649c9 commit 4dc3b75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/server/PubSub/SubscribeBroker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public unsafe int Subscribe(ref byte* key, ServerSessionBase session)
var subscriptionKey = new Span<byte>(start, (int)(key - start)).ToArray();
subscriptions.TryAdd(subscriptionKey, new ConcurrentDictionary<int, ServerSessionBase>());
if (subscriptions.TryGetValue(subscriptionKey, out var val))
val.TryAdd(sid, session);
val.TryAdd(id, session);
return id;
}

Expand Down Expand Up @@ -256,7 +256,7 @@ public unsafe int PSubscribe(ref byte* prefix, ServerSessionBase session, bool a
var subscriptionPrefix = new Span<byte>(start, (int)(prefix - start)).ToArray();
prefixSubscriptions.TryAdd(subscriptionPrefix, (ascii, new ConcurrentDictionary<int, ServerSessionBase>()));
if (prefixSubscriptions.TryGetValue(subscriptionPrefix, out var val))
val.Item2.TryAdd(sid, session);
val.Item2.TryAdd(id, session);
return id;
}

Expand Down

0 comments on commit 4dc3b75

Please sign in to comment.