Re: [Nbd] Processing client's option list
- To: Alex Bligh <alex@...872...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] Processing client's option list
- From: Wouter Verhelst <w@...112...>
- Date: Sun, 29 May 2011 11:29:14 +0200
- Message-id: <20110529092914.GC23363@...510...>
- In-reply-to: <8BCC20F6E60432780CDEB0A8@...874...>
- References: <8BCC20F6E60432780CDEB0A8@...874...>
On Sun, May 29, 2011 at 10:06:20AM +0100, Alex Bligh wrote:
> Wouter,
>
> --On 16 May 2011 23:01:51 +0100 Alex Bligh <alex@...872...> wrote:
>
> > Hmm... Another problem. How does the server know when it has
> > reached the end of the client's option list? I'd suggest
> > the client writes 4 octets of zero (in place of another
> > option identifier), but that's possibly not API
> > compatible.
>
> Can I remind you about this one? I'm puzzled about how this is
> meant to work.
I overlooked that when I defined the new negotiation. Worse, it's not
possible to add new messages without breaking the protocol, since the
server doesn't currently ignore any options it doesn't know about.
So, here's a suggestion:
- The server sets a flag "I have a fixed new-style negotiation
implementation"
- The client replies with a similar flag.
- Only if both client and server have set that bit can extra options be
used. In that case, the server must continue reading data until it
reads a packet NBD_OPT_END, with zero length. It must echo that back
to the client when it has nothing more to say.
- The server must not send any data to the client beyond what is
required for any explicit requests by the client and the NBD_OPT_END
packet.
This way, both the client and the server will know when negotiation is
finished, even if one or the other does not implement an option that is
requested by the other end.
Thoughts?
(no point in implementing the above until we actually need it, though;
the current implementation works, even if it isn't perfect)
--
The volume of a pizza of thickness a and radius z can be described by
the following formula:
pi zz a
Reply to: