[PATCH spice-server 2/4] Do not set TCP_NODELAY flag twice

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

 



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.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/inputs-channel.c | 15 ---------------
 server/spicevmc.c       | 19 -------------------
 2 files changed, 34 deletions(-)

diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index 3672d7e..223f46f 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -19,11 +19,7 @@
 #include <config.h>
 #endif
 
-#include <netinet/in.h> // IPPROTO_TCP
-#include <netinet/tcp.h> // TCP_NODELAY
-#include <fcntl.h>
 #include <stddef.h> // NULL
-#include <errno.h>
 #include <stdbool.h>
 #include <spice/macros.h>
 #include <spice/vd_agent.h>
@@ -490,17 +486,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 4c9f442..4b46e54 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -23,10 +23,7 @@
 #endif
 
 #include <assert.h>
-#include <errno.h>
 #include <string.h>
-#include <netinet/in.h> // IPPROTO_TCP
-#include <netinet/tcp.h> // TCP_NODELAY
 #ifdef USE_LZ4
 #include <lz4.h>
 #endif
@@ -445,22 +442,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;
 }
 
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]