mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-26 08:02:59 +08:00
Add more handling options to interceptor contexts.
This commit is contained in:
@@ -878,7 +878,7 @@ namespace MQTTnet.Tests.Server
|
||||
// This should lead to no subscriptions for "n" at all. So also no sending of retained messages.
|
||||
if (c.TopicFilter.Topic == "n")
|
||||
{
|
||||
c.ReasonCode = MqttSubscribeReasonCode.UnspecifiedError;
|
||||
c.Response.ReasonCode = MqttSubscribeReasonCode.UnspecifiedError;
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace MQTTnet.Tests.Server
|
||||
{
|
||||
if (context.SessionItems["can_subscribe_x"] as bool? == false)
|
||||
{
|
||||
context.ReasonCode = MqttSubscribeReasonCode.ImplementationSpecificError;
|
||||
context.Response.ReasonCode = MqttSubscribeReasonCode.ImplementationSpecificError;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace MQTTnet.Tests.Server
|
||||
{
|
||||
if (c.TopicFilter.Topic == "not_allowed_topic")
|
||||
{
|
||||
c.ReasonCode = MqttSubscribeReasonCode.TopicFilterInvalid;
|
||||
c.Response.ReasonCode = MqttSubscribeReasonCode.TopicFilterInvalid;
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user