Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CFX/CFX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.6;net8.0;netcoreapp3.1;net462</TargetFrameworks>
<PackageId>CFX.CFXSDK</PackageId>
<PackageVersion>2.0.3</PackageVersion>
<PackageVersion>2.0.5</PackageVersion>
<Authors>IPC CFX Committee</Authors>
<Description>IPC Connected Factory Exchange Open Source Software Development Kit</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -17,9 +17,9 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/IPCConnectedFactoryExchange/CFX.git</RepositoryUrl>
<PackageIcon>images/CFX_Logo.png</PackageIcon>
<Version>2.0.3</Version>
<AssemblyVersion>2.0.3.0</AssemblyVersion>
<FileVersion>2.0.3.0</FileVersion>
<Version>2.0.5</Version>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<FileVersion>2.0.5.0</FileVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>CFXStrongNameKey.snk</AssemblyOriginatorKeyFile>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
12 changes: 10 additions & 2 deletions CFX/Transport/AmqpUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ public static List<CFXEnvelope> EnvelopesFromMessage(Message msg)

internal static string StringFromEnvelopes(Message msg)
{
if (msg?.Body is byte[])
if (msg?.Body is byte[] array)
{
return Encoding.UTF8.GetString(msg.Body as byte[]);
if (string.Equals(msg.Properties.ContentEncoding, "gzip", StringComparison.OrdinalIgnoreCase))
{
array = Decode(array, CFXCodec.gzip);
}
return Encoding.UTF8.GetString(array);
}
else if (msg?.Body is string)
{
Expand Down Expand Up @@ -257,6 +261,10 @@ public static string MessagePreview(Message message, int count = 200)
string result = "";
try
{
if (string.Equals(message.Properties.ContentEncoding, "gzip", StringComparison.OrdinalIgnoreCase))
{
bt = Decode(bt, CFXCodec.gzip); ;
}
result = Encoding.UTF8.GetString(bt);
if (result.Length > count) result = result.Substring(0, count);
}
Expand Down