mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-17 17:53:03 +08:00
Fix issues in ApplicationMessageInterceptor.
This commit is contained in:
@@ -186,7 +186,10 @@ namespace MQTTnet.Server
|
||||
{
|
||||
if (interceptorContext.CloseConnection)
|
||||
{
|
||||
await queuedApplicationMessage.Sender.StopAsync().ConfigureAwait(false);
|
||||
if (sender != null)
|
||||
{
|
||||
await sender.StopAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (interceptorContext.ApplicationMessage == null || !interceptorContext.AcceptPublish)
|
||||
@@ -207,7 +210,7 @@ namespace MQTTnet.Server
|
||||
foreach (var clientSession in _sessions.Values)
|
||||
{
|
||||
clientSession.EnqueueApplicationMessage(
|
||||
queuedApplicationMessage.ApplicationMessage,
|
||||
applicationMessage,
|
||||
sender?.ClientId,
|
||||
false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user