From 5161d3e744c175e83fb5dd0095606b0e08ec6f2a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 21 Dec 2024 20:29:08 -0500 Subject: [PATCH] Drop some unreachable code in MimeReader.StepHeaders/Async() --- MimeKit/AsyncMimeReader.cs | 5 ----- MimeKit/MimeReader.cs | 5 ----- 2 files changed, 10 deletions(-) diff --git a/MimeKit/AsyncMimeReader.cs b/MimeKit/AsyncMimeReader.cs index a6ff259d2d..60406c368c 100644 --- a/MimeKit/AsyncMimeReader.cs +++ b/MimeKit/AsyncMimeReader.cs @@ -285,11 +285,6 @@ async Task StepHeadersAsync (CancellationToken cancellationToken) await OnHeaderReadAsync (header, beginLineNumber, cancellationToken).ConfigureAwait (false); } while (!eof); - if (state == MimeParserState.MessageHeaders || state == MimeParserState.Headers) { - // Ideally, we never get here. If we do, there's an exit in the loop above that should be fixed. - state = MimeParserState.Content; - } - headerBlockEnd = GetOffset (inputIndex); await OnHeadersEndAsync (headerBlockBegin, headersBeginLineNumber, headerBlockEnd, lineNumber, cancellationToken).ConfigureAwait (false); diff --git a/MimeKit/MimeReader.cs b/MimeKit/MimeReader.cs index ff4751edb9..64ba377cab 100644 --- a/MimeKit/MimeReader.cs +++ b/MimeKit/MimeReader.cs @@ -1798,11 +1798,6 @@ unsafe void StepHeaders (byte* inbuf, CancellationToken cancellationToken) OnHeaderRead (header, beginLineNumber, cancellationToken); } while (!eof); - if (state == MimeParserState.MessageHeaders || state == MimeParserState.Headers) { - // Ideally, we never get here. If we do, there's an exit in the loop above that should be fixed. - state = MimeParserState.Content; - } - headerBlockEnd = GetOffset (inputIndex); OnHeadersEnd (headerBlockBegin, headersBeginLineNumber, headerBlockEnd, lineNumber, cancellationToken);