[Spice-devel] [spice-server v4 2/6] reds-stream: Introduce reds_stream_set_no_delay() helper

Christophe Fergeau cfergeau at redhat.com
Fri Mar 31 10:19:13 UTC 2017


On Fri, Mar 31, 2017 at 05:46:08AM -0400, Frediano Ziglio wrote:
> > 
> > The code to enable/disable on a TCP socket is duplicated in multiple
> > places in the code base, this commit replaces this duplicated code with
> > a helper in RedsStream.
> > 
> > Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
> > diff --git a/server/net-utils.h b/server/net-utils.h
> > new file mode 100644
> > index 0000000..9f4932e
> > --- /dev/null
> > +++ b/server/net-utils.h
> > @@ -0,0 +1,25 @@
> > +/*
> > +   Copyright (C) 2009-2017 Red Hat, Inc.
> > +
> > +   This library is free software; you can redistribute it and/or
> > +   modify it under the terms of the GNU Lesser General Public
> > +   License as published by the Free Software Foundation; either
> > +   version 2.1 of the License, or (at your option) any later version.
> > +
> > +   This library is distributed in the hope that it will be useful,
> > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > +   Lesser General Public License for more details.
> > +
> > +   You should have received a copy of the GNU Lesser General Public
> > +   License along with this library; if not, see
> > <http://www.gnu.org/licenses/>.
> > +*/
> > +
> > +#ifndef RED_NET_UTILS_H_
> > +#define RED_NET_UTILS_H_
> > +
> > +#include <stdbool.h>
> > +
> > +bool red_socket_set_no_delay(int fd, bool no_delay);
> > +
> > +#endif
> 
> The guard is slightly different from the style you defined
> yesterday but just picky.

Fixed.

> > diff --git a/server/reds-stream.c b/server/reds-stream.c
> > index 77f9424..dbe6962 100644
> > --- a/server/reds-stream.c
> > +++ b/server/reds-stream.c
> > @@ -21,6 +21,7 @@
> >  
> >  #include <errno.h>
> >  #include <netdb.h>
> > +#include <netinet/tcp.h>
> >  #include <unistd.h>
> >  #include <sys/socket.h>
> >  #include <fcntl.h>
> 
> This should not be necessary.

And fixed too.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170331/49e0f4aa/attachment.sig>


More information about the Spice-devel mailing list