mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-11-04 05:28:51 +08:00
Add validation for topics before publishing.
This commit is contained in:
@@ -74,8 +74,11 @@ namespace MQTTnet.Internal
|
||||
Task winner;
|
||||
if (timeout == Timeout.InfiniteTimeSpan)
|
||||
{
|
||||
await tcs.Task.ConfigureAwait(false);
|
||||
winner = tcs.Task;
|
||||
using (cancellationToken.Register(() => { tcs.TrySetCanceled(); }))
|
||||
{
|
||||
await tcs.Task.ConfigureAwait(false);
|
||||
winner = tcs.Task;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -122,7 +125,7 @@ namespace MQTTnet.Internal
|
||||
}
|
||||
}
|
||||
|
||||
toRelease?.SetResult(true);
|
||||
toRelease?.TrySetResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user