mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-02 14:28:32 +00:00
server/red_channel: fix unused variable
unused variable 'so_unsent_size' [-Werror=unused-variable]
This commit is contained in:
parent
51511a51cf
commit
3ef0480658
@ -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)*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user