[Spice-commits] 2 commits - server/red_channel.c server/red_worker.c

Alon Levy alon at kemper.freedesktop.org
Mon Jul 29 07:55:26 PDT 2013


 server/red_channel.c |   23 +++++++++++++----------
 server/red_worker.c  |    5 -----
 2 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit 3ef04806589f51270c96b5cfe4df57e614f1d0be
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Jul 28 22:12:01 2013 +0300

    server/red_channel: fix unused variable
    
    unused variable 'so_unsent_size' [-Werror=unused-variable]

diff --git a/server/red_channel.c b/server/red_channel.c
index 31c991b..33af388 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -720,22 +720,25 @@ static void red_channel_client_push_ping(RedChannelClient *rcc)
 
 static void red_channel_client_ping_timer(void *opaque)
 {
-    int so_unsent_size = 0;
     RedChannelClient *rcc = opaque;
 
     spice_assert(rcc->latency_monitor.state == PING_STATE_TIMER);
     red_channel_client_cancel_ping_timer(rcc);
 
 #ifdef HAVE_LINUX_SOCKIOS_H /* SIOCOUTQ is a Linux only ioctl on sockets. */
-    /* retrieving the occupied size of the socket's tcp snd buffer (unacked + unsent) */
-    if (ioctl(rcc->stream->socket, SIOCOUTQ, &so_unsent_size) == -1) {
-        spice_printerr("ioctl(SIOCOUTQ) failed, %s", strerror(errno));
-    }
-    if (so_unsent_size > 0) {
-        /* tcp snd buffer is still occupied. rescheduling ping */
-        red_channel_client_start_ping_timer(rcc, PING_TEST_IDLE_NET_TIMEOUT_MS);
-    } else {
-        red_channel_client_push_ping(rcc);
+    {
+        int so_unsent_size = 0;
+
+        /* retrieving the occupied size of the socket's tcp snd buffer (unacked + unsent) */
+        if (ioctl(rcc->stream->socket, SIOCOUTQ, &so_unsent_size) == -1) {
+            spice_printerr("ioctl(SIOCOUTQ) failed, %s", strerror(errno));
+        }
+        if (so_unsent_size > 0) {
+            /* tcp snd buffer is still occupied. rescheduling ping */
+            red_channel_client_start_ping_timer(rcc, PING_TEST_IDLE_NET_TIMEOUT_MS);
+        } else {
+            red_channel_client_push_ping(rcc);
+        }
     }
 #else /* ifdef HAVE_LINUX_SOCKIOS_H */
     /* More portable alternative code path (less accurate but avoids bogus ioctls)*/
commit 51511a51cf10cac37d232ba539f1291e30a5674e
Author: Alon Levy <alevy at redhat.com>
Date:   Tue May 28 18:01:45 2013 -0400

    server/red_worker.c: remove unused pipe_item_remove

diff --git a/server/red_worker.c b/server/red_worker.c
index 73fe866..b45208b 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1381,11 +1381,6 @@ static inline int pipe_item_is_linked(PipeItem *item)
     return ring_item_is_linked(&item->link);
 }
 
-static inline void pipe_item_remove(PipeItem *item)
-{
-    ring_remove(&item->link);
-}
-
 static void red_pipe_add_verb(RedChannelClient* rcc, uint16_t verb)
 {
     VerbItem *item = spice_new(VerbItem, 1);


More information about the Spice-commits mailing list