Re: [Nbd] [PATCH] server: Read client's length data before next option
- To: Eric Blake <eblake@...696...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] [PATCH] server: Read client's length data before next option
- From: Wouter Verhelst <w@...112...>
- Date: Sat, 15 Oct 2016 19:53:19 +0200
- Message-id: <20161015175319.fohjt3d2fucfuyfx@...3...>
- In-reply-to: <6cd2bbe2-e47e-02de-b056-8b1264943a02@...696...>
- References: <1476478938-8121-1-git-send-email-eblake@...696...> <6cd2bbe2-e47e-02de-b056-8b1264943a02@...696...>
On Fri, Oct 14, 2016 at 04:36:38PM -0500, Eric Blake wrote:
> On 10/14/2016 04:02 PM, Eric Blake wrote:
>
> > /**
> > * Consume data from a socket that we don't want
> > *
> > - * @param f a file descriptor
> > + * @param c the client data stream
> > * @param buf a buffer
> > * @param len the number of bytes to consume
> > * @param bufsiz the size of the buffer
> > @@ -373,6 +373,21 @@ static inline void consume(CLIENT* c, void * buf, size_t len, size_t bufsiz) {
>
> This signature threw me off. Good design says that if you are going to
> have paired parameters (buf and bufsize), you generally want them
> adjacent, not separated by an unrelated parameter (len). Shall I submit
> the obvious patch to swap parameter order and update all callers?
Yes, probably a good idea. Thanks.
--
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
people in the world who think they really understand all of its rules,
and pretty much all of them are just lying to themselves too.
-- #debian-devel, OFTC, 2016-02-12
Reply to: