The RFC 3501 section 7.4.2FETCH response for a BODY[<section>]<<origin octet>> (or the corresponding BINARY from RFC 3516) is allowed to be NIL (it’s an nstring), corresponding to a non-existing body section.
For example, if the client requests BODY.PEEK[4.2] and there’s no 4.2 for that particular message, the server will respond with BODY[4.2] NIL.
Modifications:
Add a MessageAttribute corresponding to this NIL value.
Note that the non-nil version uses FetchResponse.streamingBegin(…), .streamingBytes(…), and .streamingEnd, whereas the NIL variant uses FetchResponse.simpleAttribute since it won’t be streaming any data.
Allow
NIL
response for a particular body sectionMotivation:
The RFC 3501 section 7.4.2
FETCH
response for aBODY[<section>]<<origin octet>>
(or the correspondingBINARY
from RFC 3516) is allowed to beNIL
(it’s annstring
), corresponding to a non-existing body section.For example, if the client requests
BODY.PEEK[4.2]
and there’s no 4.2 for that particular message, the server will respond withBODY[4.2] NIL
.Modifications:
Add a
MessageAttribute
corresponding to thisNIL
value.Note that the non-nil version uses
FetchResponse.streamingBegin(…)
,.streamingBytes(…)
, and.streamingEnd
, whereas theNIL
variant usesFetchResponse.simpleAttribute
since it won’t be streaming any data.Added test cases for encoding and parsing.