Capability in response code#6
Merged
Merged
Conversation
98adfdb to
27a7f27
Compare
This was referenced Nov 9, 2020
Merged
27a7f27 to
fe77596
Compare
`accept` can be used to replace `lookahead` + check `token.symbol` + `shift_token`. It's not being used here, but has been separated out into its own commit to reduce merge conflicts from multiple branches which use it.
`astring_chars` roughly matches the RFC2060 definition of `atom`, and is used by RFC3501's `astring`. `atom` matches the RFC3501 definition. Although nothing in the parser currently uses `atom`, future commits will update use it where it's used by RFC3501, RFC4466, etc. Made a helper method, `combine_adjacent` which is used by both `atom` and `astring_chars` to combine adjacent tokens into a single string. It would probably be better to update the lexer regexps, possibly using negative lookahead assertions, so that it returns a single token.
In RFC3501, "capability-data" is found both in "response-data" and in "resp-text-code". Many IMAP servers return CAPABILITY codes in the server greeting or in the tagged OK for STARTTLS, LOGIN, or AUTHENTICATE. This adds parsing for CAPABILITY data in a ResponseCode, the same as already existed for CAPABILITY data in an UntaggedResponse.
A minor annoyance. :) The RFC3501 ABNF implies that the "text" we are concerned with comes after the space: resp-text = ["[" resp-text-code "]" SP] text
fe77596 to
fc14be6
Compare
Member
|
@nevans I've merged it. Thank you! |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In RFC3501,
capability-datais found both inresponse-dataand inresp-text-code. Many IMAP servers returnCAPABILITYcodes in theserver greeting or in the tagged
OKforSTARTTLS,LOGIN, orAUTHENTICATE.This adds parsing for
CAPABILITYdata in aResponseCode, the same asalready existed for
CAPABILITYdata in anUntaggedResponse.This also fixes
resp-textto properly match the text that comes after aresp-text-code. The extraSPhas been removed.n.b. I submitted this PR previously, before net-imap was gemified: