[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [PATCH] server: Read client's length data before next option



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: