Skip to content

Commit

Permalink
Soundness
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidde94 committed Feb 21, 2022
1 parent 41e1595 commit b91bb8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Sources/NIOIMAPCore/Grammar/Message/MessageAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public enum MessageAttribute: Hashable {
case uid(UID)
/// `RFC822.SIZE` -- A number expressing the RFC 2822 size of the message.
case rfc822Size(Int)

case rfc822(ByteBuffer?)

case rfc822Text(ByteBuffer?)

case rfc822Header(ByteBuffer?)

/// `BODYSTRUCTURE` or `BODY` -- A list that describes the MIME body structure of a message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ extension GrammarParser {
try PL.parseFixedString(")", buffer: &buffer, tracker: tracker)
return .gmailLabels(attributes)
}

func parseMessageAttribute_rfc822(buffer: inout ParseBuffer, tracker: StackTracker) throws -> MessageAttribute {
try PL.parseSpaces(buffer: &buffer, tracker: tracker)
return .rfc822(try self.parseNString(buffer: &buffer, tracker: tracker))
}

func parseMessageAttribute_rfc822Text(buffer: inout ParseBuffer, tracker: StackTracker) throws -> MessageAttribute {
try PL.parseSpaces(buffer: &buffer, tracker: tracker)
return .rfc822Text(try self.parseNString(buffer: &buffer, tracker: tracker))
}

func parseMessageAttribute_rfc822Header(buffer: inout ParseBuffer, tracker: StackTracker) throws -> MessageAttribute {
try PL.parseSpaces(buffer: &buffer, tracker: tracker)
return .rfc822Header(try self.parseNString(buffer: &buffer, tracker: tracker))
Expand All @@ -206,7 +206,7 @@ extension GrammarParser {
"X-GM-THRID": parseMessageAttribute_gmailThreadID,
"X-GM-LABELS": parseMessageAttribute_gmailLabels,
"MODSEQ": parseMessageAttribute_fetchModifierResponse,

// note the order matters here
// RFC822 needs to be the *last* attempted out of
// all of the RFC822.* options, as RFC822.SIZE will
Expand Down

0 comments on commit b91bb8b

Please sign in to comment.