[Spice-devel] [PATCH spice-server 3/4] Do not set TCP_NODELAY flag twice
Frediano Ziglio
fziglio at redhat.com
Tue Feb 14 15:13:44 UTC 2017
>
> On Mon, Feb 13, 2017 at 11:03:18AM +0000, Frediano Ziglio wrote:
> > TCP_NODELAY flag is set by default for all connection inside
> > reds.c so there's no need to set again for the single
> > client channel.
> >
> > Note that there are still some call to setsockopt to set this
> > option but in this case the flag can reset the flag.
>
> I happen to have written the attached patch yesterday too which is
> related, can you pick it up in that patch series?
>
> Christophe
>
Yes, I'll rebase after your series has been merged (looks in
a good shape) and add your patch.
Frediano
> >
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> > server/inputs-channel.c | 11 -----------
> > server/spicevmc.c | 16 ----------------
> > 2 files changed, 27 deletions(-)
> >
> > diff --git a/server/inputs-channel.c b/server/inputs-channel.c
> > index f105b4d..897e8e7 100644
> > --- a/server/inputs-channel.c
> > +++ b/server/inputs-channel.c
> > @@ -490,17 +490,6 @@ static void inputs_pipe_add_init(RedChannelClient
> > *rcc)
> >
> > static int inputs_channel_config_socket(RedChannelClient *rcc)
> > {
> > - int delay_val = 1;
> > - RedsStream *stream = red_channel_client_get_stream(rcc);
> > -
> > - if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
> > - &delay_val, sizeof(delay_val)) == -1) {
> > - if (errno != ENOTSUP && errno != ENOPROTOOPT) {
> > - spice_printerr("setsockopt failed, %s", strerror(errno));
> > - return FALSE;
> > - }
> > - }
> > -
> > return TRUE;
> > }
> >
> > diff --git a/server/spicevmc.c b/server/spicevmc.c
> > index 9bcbada..1003a2f 100644
> > --- a/server/spicevmc.c
> > +++ b/server/spicevmc.c
> > @@ -427,22 +427,6 @@ static void
> > spicevmc_char_dev_remove_client(RedCharDevice *self,
> >
> > static int spicevmc_red_channel_client_config_socket(RedChannelClient
> > *rcc)
> > {
> > - int delay_val = 1;
> > - RedsStream *stream = red_channel_client_get_stream(rcc);
> > - RedChannel *channel = red_channel_client_get_channel(rcc);
> > - uint32_t type;
> > -
> > - g_object_get(channel, "channel-type", &type, NULL);
> > - if (type == SPICE_CHANNEL_USBREDIR) {
> > - if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
> > - &delay_val, sizeof(delay_val)) != 0) {
> > - if (errno != ENOTSUP && errno != ENOPROTOOPT) {
> > - spice_printerr("setsockopt failed, %s", strerror(errno));
> > - return FALSE;
> > - }
> > - }
> > - }
> > -
> > return TRUE;
> > }
> >
More information about the Spice-devel
mailing list