mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-25 04:47:51 +00:00
ClientStateMachine sent the first chunk of each APPEND part and dropped
the rest. A part holding a synchronizing literal before its end lost
everything after the literal header and didn't wait for `+` (RFC 3501
§4.3, §7.5): a mailbox like "å" became `A1 APPEND {2}\r\n {5}\r\n`; a
CATENATE URL over 70 bytes became `URL {90}\r\n)`; the next `+` threw
UnexpectedContinuationRequest. Also on main.
New state appendingLiteral holds the part's remaining chunks until `+`.
A tagged response while waiting fails the part's promise with the
UnexpectedResponse, as for other literals; channel close fails it.
Behavior change: such parts are sent whole, after `+`; their write
promise completes once the last chunk is written.
If the APPEND completes while a part waits for `+` (unreachable today:
`.finish` has no literal), throw UnexpectedResponse rather than rely on
an assert compiled out in release.