[Spice-devel] [PATCH 6/6] Do not assume that SPICE is using a TCP socket

Daniel P. Berrange berrange at redhat.com
Mon Dec 12 08:52:33 PST 2011


From: "Daniel P. Berrange" <berrange at redhat.com>

If setting the TCP_NODELAY socket option fails with ENOTSUP,
then don't treat this is a fatal error. SPICE is likely just
running over a UNIX socket instead.

* server/inputs_channel.c: Ignore TCP_NODELAY socket opt fails

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 server/inputs_channel.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index c8b42e3..0fa4162 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -466,8 +466,10 @@ static int inputs_channel_config_socket(RedChannelClient *rcc)
 
     if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
             &delay_val, sizeof(delay_val)) == -1) {
-        red_printf("setsockopt failed, %s", strerror(errno));
-        return FALSE;
+        if (errno != ENOTSUP) {
+            red_printf("setsockopt failed, %s", strerror(errno));
+            return FALSE;
+        }
     }
 
     if ((flags = fcntl(stream->socket, F_GETFL)) == -1 ||
-- 
1.7.7.3



More information about the Spice-devel mailing list