Do not set not blocking flag twice

Non blocking flag is set for all connection inside reds.c so
there's no need to set again for the single client channel.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-02-12 21:03:23 +00:00
parent f603f17317
commit 469b94eb4e
2 changed files with 0 additions and 22 deletions

View File

@ -117,20 +117,9 @@ int common_channel_config_socket(RedChannelClient *rcc)
RedClient *client = red_channel_client_get_client(rcc);
MainChannelClient *mcc = red_client_get_main(client);
RedsStream *stream = red_channel_client_get_stream(rcc);
int flags;
int delay_val;
gboolean is_low_bandwidth;
if ((flags = fcntl(stream->socket, F_GETFL)) == -1) {
spice_warning("accept failed, %s", strerror(errno));
return FALSE;
}
if (fcntl(stream->socket, F_SETFL, flags | O_NONBLOCK) == -1) {
spice_warning("accept failed, %s", strerror(errno));
return FALSE;
}
// TODO - this should be dynamic, not one time at channel creation
is_low_bandwidth = main_channel_client_is_low_bandwidth(mcc);
delay_val = is_low_bandwidth ? 0 : 1;

View File

@ -740,7 +740,6 @@ static void record_channel_send_item(RedChannelClient *rcc, G_GNUC_UNUSED RedPip
static int snd_channel_config_socket(RedChannelClient *rcc)
{
int delay_val;
int flags;
#ifdef SO_PRIORITY
int priority;
#endif
@ -749,11 +748,6 @@ static int snd_channel_config_socket(RedChannelClient *rcc)
RedClient *red_client = red_channel_client_get_client(rcc);
MainChannelClient *mcc = red_client_get_main(red_client);
if ((flags = fcntl(stream->socket, F_GETFL)) == -1) {
spice_printerr("accept failed, %s", strerror(errno));
return FALSE;
}
#ifdef SO_PRIORITY
priority = 6;
if (setsockopt(stream->socket, SOL_SOCKET, SO_PRIORITY, (void*)&priority,
@ -778,11 +772,6 @@ static int snd_channel_config_socket(RedChannelClient *rcc)
}
}
if (fcntl(stream->socket, F_SETFL, flags | O_NONBLOCK) == -1) {
spice_printerr("accept failed, %s", strerror(errno));
return FALSE;
}
return TRUE;
}