Skip to content

Commit 7c76652

Browse files
committed
Sonar happiness
1 parent e51d0e5 commit 7c76652

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

nanoFramework.Aws.IoTCore.Devices/AwsSignatureVersion4/SignerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class SignerBase
4444

4545
// algorithm used to hash the canonical request that is supplied to
4646
// the signature computation
47-
internal static SHA256 CanonicalRequestHashAlgorithm = SHA256.Create();
47+
internal static readonly SHA256 CanonicalRequestHashAlgorithm = SHA256.Create();
4848

4949
/// <summary>
5050
/// The service endpoint, including the path to any resource.

nanoFramework.Aws.IoTCore.Devices/AwsSignatureVersion4/SignerForAuthorizationHeader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public string ComputeSignature(IDictionary headers,
5757
headers.Add(X_Amz_Date, dateTimeStamp);
5858

5959
var hostHeader = EndpointUri.Host;
60-
hostHeader += ":" + EndpointUri.Port; // FIXME: should use //if (!EndpointUri.IsDefaultPort)
60+
hostHeader += ":" + EndpointUri.Port; // TODO: should use //if (!EndpointUri.IsDefaultPort)
6161
headers.Add("Host", hostHeader);
6262

6363
// canonicalize the headers; we need the set of header names as well as the

nanoFramework.Aws.IoTCore.Devices/AwsSignatureVersion4/SignerForChunkedUpload.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public string ComputeSignature(IDictionary headers,
9292
headers.Add(X_Amz_Date, DateTimeStamp);
9393

9494
var hostHeader = EndpointUri.Host;
95-
hostHeader += ":" + EndpointUri.Port; // FIXME: should use //if (!EndpointUri.IsDefaultPort)
95+
hostHeader += ":" + EndpointUri.Port; // TODO: should use //if (!EndpointUri.IsDefaultPort)
9696
headers.Add("Host", hostHeader);
9797

9898
// canonicalize the headers; we need the set of header names as well as the

nanoFramework.Aws.IoTCore.Devices/AwsSignatureVersion4/SignerForPOST.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public string ComputeSignature(IDictionary headers,
7272
headers.Add(X_Amz_Date, dateTimeStamp);
7373

7474
var hostHeader = EndpointUri.Host;
75-
hostHeader += ":" + EndpointUri.Port; // FIXME: should use //if (!EndpointUri.IsDefaultPort)
75+
hostHeader += ":" + EndpointUri.Port; // TODO: should use //if (!EndpointUri.IsDefaultPort)
7676
headers.Add("Host", hostHeader);
7777

7878
// canonicalize the headers; we need the set of header names as well as the

nanoFramework.Aws.IoTCore.Devices/AwsSignatureVersion4/SignerForQueryParameterAuth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public string ComputeSignature(IDictionary headers,
5959
if (!headers.Contains("Host"))
6060
{
6161
var hostHeader = EndpointUri.Host;
62-
hostHeader += ":" + EndpointUri.Port; // FIXME: should use //if (!EndpointUri.IsDefaultPort)
62+
hostHeader += ":" + EndpointUri.Port; // TODO: should use //if (!EndpointUri.IsDefaultPort)
6363
headers.Add("Host", hostHeader);
6464
}
6565

nanoFramework.Aws.IoTCore.Devices/WebsocketConnectionClient.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class WebsocketConnectionClient : IDisposable
3434

3535
const int _wssPort = 443; //Default WSS port.
3636

37-
//WebSocket _webSocket = null;
37+
private WebSocket _webSocket = null;
3838

3939
/// <summary>
4040
/// Creates a new MQTT over WebSocket Connection Client
@@ -44,6 +44,8 @@ public class WebsocketConnectionClient : IDisposable
4444
/// </remarks>
4545
public WebsocketConnectionClient()
4646
{
47+
//_webSocket = new WebSocket();
48+
4749
// TODO: implement! look to the following:
4850
// https://github.com/dotnet/MQTTnet/blob/master/Source/MQTTnet.Extensions.WebSocket4Net/WebSocket4NetMqttChannel.cs
4951

@@ -66,6 +68,12 @@ public WebsocketConnectionClient()
6668
/// <inheritdoc/>
6769
public void Dispose()
6870
{
71+
if (_webSocket != null)
72+
{
73+
// Cleaning
74+
GC.SuppressFinalize(_webSocket);
75+
_webSocket = null;
76+
}
6977

7078
}
7179
}

0 commit comments

Comments
 (0)