On Tue, 9 Jul 2002, David Harris wrote:
> assume we
> have a message with 384 bytes, and the client issues this command:
> A30 FETCH 42 (BODY[TEXT]<385.16384>)<cr><lf>
> Am I correct in assuming that the correct return for this command is:
> * 42 FETCH (BODY[TEXT]<385> {0})<cr><lf>
Close, but not quite.
The correct response is either:
* 42 FETCH (BODY[TEXT]<385> {0}<cr><lf>)<cr><lf>
or
* 42 FETCH (BODY[TEXT]<385> "")<cr><lf>
> * Is the zero-length literal declaration mandatory? (I'm sure it is, but
> I'd like this confirmed by greater minds).
I'm not sure that I understand your question. Either a zero-length
literal or a zero-length quoted-string will suffice.
> * Is the proper partial startpoint in the response "385", even though
> that value is effectively invalid?
Yes.
The reason is that the client has to be able to associate the server
response of BODY[TEXT]<385> with its request for BODY[TEXT]<385.16384>.
There are, indeed, zero bytes starting at byte 385, and this is the proper
response to indicate "at EOF".
The more difficult issue is if the client asked for BODY[TEXT]<386.16384>.
I contend that BODY[TEXT]<386> (zero bytes starting at byte 386) in no way
implies that byte 385 exists, and thus the server should respond in the
same way rather than issuing an error. Of course, it is difficult to
imagine a client actually generating BODY[TEXT]<386.16384> without already
having a byte 385.
-- Mark --
http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.