♻️ Improve internal literal sending (partially backports #616, #649)#652
Merged
nevans merged 6 commits intov0.5-stablefrom Apr 22, 2026
Merged
Conversation
`Net::IMAP::Literal` is currently only used by `#append` and `#id`, but more code will be refactored to use it in the (near?) future.
This adds the ability to send binary `literal8`, which were already supported by the parser for `FETCH`. It does *not* automatically use `literal8` in `#append` when the message includes `NULL` bytes.
This tests literal sending a lot more thoroughly. Most importantly, this tests both continuation rejection and continuation request. Added `literal_acceptor` proc to FakeServer, which returns if server accepts specific literal continuation, and can be varied per test.
This is internal only, for now. It is only used by `Literal` and `Literal8`, and only when `non_synchronizing` is _explicitly_ set to `true` or `false`. `CommandData` only has a single `#data` attr, so this updates `Literal` to no longer inherit from `CommandData`. `non_synchronizing` is optional. The intent is to make it tri-state: * `true` -> force non-synchronizing `LITERAL+`/`LITERAL-` behavior * `false` -> force normal synchronizing literal behavior * `nil` -> dynamic behavior, based on capabilities and literal size The `nil` behavior will be implemented in a separate commit.
I thought rdoc had fixed their endless method definition bugs with the upgrade to using prism?
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.
This partially backports:
BINARYextention to#append(RFC3516) #616LITERAL+andLITERAL-non-synchronizing literals (RFC7888) #649It backports most of the internal code and tests. However, it does not actually add
BINARYsupport to#append, nor does it automatically send non-synchronizing literals. But it does addLiteral8, and it adds anon_syncoption to bothLiteralandLiteral8.