[Spice-commits] server/red_tunnel_worker.c server/red_worker.c server/reds.c server/snd_worker.c server/spicevmc.c

Hans de Goede jwrdegoede at kemper.freedesktop.org
Wed Jan 18 02:19:36 PST 2012


 server/red_tunnel_worker.c |    4 +++-
 server/red_worker.c        |    4 +++-
 server/reds.c              |    4 +++-
 server/snd_worker.c        |    8 ++++++--
 server/spicevmc.c          |    6 ++++--
 5 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit dc7855967f4e8aa4f1aee422cb8f09a414d8c69e
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Jan 18 10:47:30 2012 +0100

    server: Don't complain if setsockopt NODELAY fails on unix sockets
    
    With Daniel P. Berrange's patches to allow use of pre-supplied fd's
    as channels, we can no longer be sure that our connections are TCP
    sockets, so it makes no sense to complain if a TCP/IP specific
    setsockopt fails with an errno of ENOTSUP.
    
    Note that this extends Daniel's commit 492ddb5d1d595e2d12208f4602b18e4432f4e6b4
    which already added the same check to server/inputs_channel.c
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/server/red_tunnel_worker.c b/server/red_tunnel_worker.c
index c2019dd..9162da4 100644
--- a/server/red_tunnel_worker.c
+++ b/server/red_tunnel_worker.c
@@ -3365,7 +3365,9 @@ static int tunnel_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));
+        if (errno != ENOTSUP) {
+            red_printf("setsockopt failed, %s", strerror(errno));
+        }
     }
 
     return TRUE;
diff --git a/server/red_worker.c b/server/red_worker.c
index 983d767..c2ab957 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9498,7 +9498,9 @@ static int common_channel_config_socket(RedChannelClient *rcc)
     // TODO - this should be dynamic, not one time at channel creation
     delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1;
     if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
-        red_printf("setsockopt failed, %s", strerror(errno));
+        if (errno != ENOTSUP) {
+            red_printf("setsockopt failed, %s", strerror(errno));
+        }
     }
     return TRUE;
 }
diff --git a/server/reds.c b/server/reds.c
index b97a061..2492a89 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2706,7 +2706,9 @@ static RedLinkInfo *reds_init_client_connection(int socket)
     }
 
     if (setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
-        red_printf("setsockopt failed, %s", strerror(errno));
+        if (errno != ENOTSUP) {
+            red_printf("setsockopt failed, %s", strerror(errno));
+        }
     }
 
     link = spice_new0(RedLinkInfo, 1);
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 0527009..cb64c99 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -919,12 +919,16 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
 
     tos = IPTOS_LOWDELAY;
     if (setsockopt(stream->socket, IPPROTO_IP, IP_TOS, (void*)&tos, sizeof(tos)) == -1) {
-        red_printf("setsockopt failed, %s", strerror(errno));
+        if (errno != ENOTSUP) {
+            red_printf("setsockopt failed, %s", strerror(errno));
+        }
     }
 
     delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1;
     if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) {
-        red_printf("setsockopt failed, %s", strerror(errno));
+        if (errno != ENOTSUP) {
+            red_printf("setsockopt failed, %s", strerror(errno));
+        }
     }
 
     if (fcntl(stream->socket, F_SETFL, flags | O_NONBLOCK) == -1) {
diff --git a/server/spicevmc.c b/server/spicevmc.c
index c2e249c..5cdc513 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -92,8 +92,10 @@ static int spicevmc_red_channel_client_config_socket(RedChannelClient *rcc)
     if (rcc->channel->type == SPICE_CHANNEL_USBREDIR) {
         if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
                 &delay_val, sizeof(delay_val)) != 0) {
-            red_printf("setsockopt failed, %s", strerror(errno));
-            return FALSE;
+            if (errno != ENOTSUP) {
+                red_printf("setsockopt failed, %s", strerror(errno));
+                return FALSE;
+            }
         }
     }
 


More information about the Spice-commits mailing list