[Spice-commits] server/inputs-channel.c server/spicevmc.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Feb 15 12:39:50 UTC 2017
server/inputs-channel.c | 15 ---------------
server/spicevmc.c | 19 -------------------
2 files changed, 34 deletions(-)
New commits:
commit 01c25074dccf9561a52336cf1a636108a584372f
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sun Feb 12 21:10:46 2017 +0000
Do not set TCP_NODELAY flag twice
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 calls to setsockopt to change this
option.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
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;
}
More information about the Spice-commits
mailing list