From c40f21bfdf159570ef0e061f9462e9dcd24586da Mon Sep 17 00:00:00 2001 From: Nathan Brown Date: Thu, 11 Apr 2024 19:17:22 -0700 Subject: [PATCH 1/2] Normalize line endings --- .gitattributes | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..1b5a8751 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,58 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +*.sln text eol=crlf +*.csproj text eol=crlf +*.vbproj text eol=crlf +*.vcxproj text eol=crlf +*.vcproj text eol=crlf +*.dbproj text eol=crlf +*.fsproj text eol=crlf +*.lsproj text eol=crlf +*.wixproj text eol=crlf +*.modelproj text eol=crlf +*.sqlproj text eol=crlf +*.wmaproj text eol=crlf + +*.xproj text eol=crlf +*.props text eol=crlf +*.filters text eol=crlf +*.vcxitems text eol=crlf +*.dgml text eol=crlf + +*.bat text eol=crlf +*.cmd text eol=crlf +*.sh text eol=lf + +*.DotSettings text eol=lf +*.svg text eol=lf +*.kts text eol=lf + +*.cs diff=csharp +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +*.exe binary +*.pdf binary +*.bmp binary +*.cur binary +*.dll binary +*.doc binary +*.docx binary +*.ico binary +*.jpg binary +*.ocx binary +*.xls binary +*.xlsx binary +*.png binary +*.gif binary From a5acf7e9340d903e6920982f85a5db4e89454af4 Mon Sep 17 00:00:00 2001 From: Nathan Brown Date: Thu, 11 Apr 2024 19:22:57 -0700 Subject: [PATCH 2/2] Skip over List and Map encountered by ReadAny --- .../AMQP/AmqpWireFormattingRead.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/RabbitMQ.Stream.Client/AMQP/AmqpWireFormattingRead.cs b/RabbitMQ.Stream.Client/AMQP/AmqpWireFormattingRead.cs index ca64d56d..5f827779 100644 --- a/RabbitMQ.Stream.Client/AMQP/AmqpWireFormattingRead.cs +++ b/RabbitMQ.Stream.Client/AMQP/AmqpWireFormattingRead.cs @@ -148,6 +148,35 @@ internal static int ReadAny(ref SequenceReader reader, out object value) value = null; reader.Advance(1); return 1; + + case FormatCode.List0: + case FormatCode.List8: + case FormatCode.List32: + { + offset = ReadListHeader(ref reader, out var fields); + for (long i = 0; i < fields; i++) + { + offset += ReadAny(ref reader, out _); + } + + value = null; + return offset; + } + + case FormatCode.Map8: + case FormatCode.Map32: + { + offset = ReadMapHeader(ref reader, out var count); + var values = count / 2; + for (uint i = 0; i < values; i++) + { + offset += ReadAny(ref reader, out _); + offset += ReadAny(ref reader, out _); + } + + value = null; + return offset; + } } throw new AmqpParseException($"Read Any: Invalid type: {type}");