Skip to content

Commit

Permalink
Fix references. Fix certificate handing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed Nov 11, 2017
1 parent 9692ae5 commit 3625363
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Build/MQTTnet.AspNetCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
<package >
<metadata>
<id>MQTTnet.AspNetCore</id>
<version>2.5.0</version>
<version>2.5.1</version>
<authors>Christian Kratky</authors>
<owners>Christian Kratky</owners>
<licenseUrl>https://github.com/chkr1011/MQTTnet/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/chkr1011/MQTTnet</projectUrl>
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is a support library to integrate MQTTnet into AspNetCore.</description>
<releaseNotes>initial version
<releaseNotes>* Updated to MQTTnet 2.5.1.
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2017</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="MQTTnet" version="2.5" />
<dependency id="MQTTnet" version="2.5.1" />
</group>
</dependencies>
</metadata>
Expand Down
7 changes: 4 additions & 3 deletions Build/MQTTnet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
<iconUrl>https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker).</description>
<releaseNotes>*
<releaseNotes>* Fixed several library reference issues.
* [Client] Fixed issue in _MqttClientOptionsBuilder_ when using no certificates (Thanks to 1iveowl).
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2017</copyright>
<tags>MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin</tags>
<dependencies>

<group targetFramework="netstandard1.3">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="NETStandard.Library" version="1.3" />
<dependency id="Microsoft.Extensions.DependencyInjection" version="1.1.1" />
<dependency id="Microsoft.Extensions.Logging" version="1.1.2" />
<dependency id="Microsoft.Extensions.Options" version="1.1.2" />
Expand Down Expand Up @@ -45,7 +46,7 @@
<dependency id="Microsoft.Extensions.Options" version="1.1.2" />
</group>

<group targetFramework="net451">
<group targetFramework="net452">
<dependency id="Microsoft.Extensions.DependencyInjection" version="1.1.1" />
<dependency id="Microsoft.Extensions.Logging" version="1.1.2" />
<dependency id="Microsoft.Extensions.Options" version="1.1.2" />
Expand Down
2 changes: 1 addition & 1 deletion MQTTnet.Core/Client/MqttClientOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public MqttClientOptionsBuilder WithTls(
AllowUntrustedCertificates = allowUntrustedCertificates,
IgnoreCertificateChainErrors = ignoreCertificateChainErrors,
IgnoreCertificateRevocationErrors = ignoreCertificateRevocationErrors,
Certificates = certificates.ToList()
Certificates = certificates?.ToList()
};

return this;
Expand Down
5 changes: 5 additions & 0 deletions MQTTnet.Core/Server/MqttClientPendingMessagesQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public void Start(IMqttCommunicationAdapter adapter, CancellationToken cancellat
{
if (adapter == null) throw new ArgumentNullException(nameof(adapter));

if (cancellationToken.IsCancellationRequested)
{
return;
}

Task.Run(async () => await SendPendingPublishPacketsAsync(adapter, cancellationToken), cancellationToken).ConfigureAwait(false);
}

Expand Down
8 changes: 5 additions & 3 deletions MQTTnet.Core/Server/MqttClientSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ public async Task RunAsync(MqttApplicationMessage willMessage, IMqttCommunicatio

try
{
var cancellationTokenSource = new CancellationTokenSource();

_willMessage = willMessage;
_adapter = adapter;
_cancellationTokenSource = new CancellationTokenSource();
_cancellationTokenSource = cancellationTokenSource;

_pendingMessagesQueue.Start(adapter, _cancellationTokenSource.Token);
await ReceivePacketsAsync(adapter, _cancellationTokenSource.Token).ConfigureAwait(false);
_pendingMessagesQueue.Start(adapter, cancellationTokenSource.Token);
await ReceivePacketsAsync(adapter, cancellationTokenSource.Token).ConfigureAwait(false);
}
catch (OperationCanceledException)
{
Expand Down

0 comments on commit 3625363

Please sign in to comment.