summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2013-07-28 22:12:01 +0300
committerAlon Levy <alevy@redhat.com>2013-07-28 22:12:01 +0300
commit3ef04806589f51270c96b5cfe4df57e614f1d0be (patch)
tree3ef635a1fbdd78fb2239adb2274170635d444706 /server
parent51511a51cf10cac37d232ba539f1291e30a5674e (diff)
downloadspice-3ef04806589f51270c96b5cfe4df57e614f1d0be.tar.gz
spice-3ef04806589f51270c96b5cfe4df57e614f1d0be.tar.xz
spice-3ef04806589f51270c96b5cfe4df57e614f1d0be.zip
server/red_channel: fix unused variable
unused variable 'so_unsent_size' [-Werror=unused-variable]
Diffstat (limited to 'server')
-rw-r--r--server/red_channel.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index 31c991b4..33af388d 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)*/