summaryrefslogtreecommitdiffstats
path: root/server/snd_worker.c
diff options
context:
space:
mode:
authorNahum Shalman <nshalman-github@elys.com>2012-01-19 14:10:02 -0600
committerAlon Levy <alevy@redhat.com>2012-01-23 12:28:58 +0200
commit781706ea0de422b95112f064c37f69ec4715a87b (patch)
tree97ced98cb41e11ac05f8f380f84edb09234eadac /server/snd_worker.c
parent89cc196a1b6b93d702ed456cd003d12ae304f9cf (diff)
downloadspice-781706ea0de422b95112f064c37f69ec4715a87b.tar.gz
spice-781706ea0de422b95112f064c37f69ec4715a87b.tar.xz
spice-781706ea0de422b95112f064c37f69ec4715a87b.zip
server: don't complain if setsockopt(SO_PRIORITY) call fails
dc7855967f4e did this for the TCP_NODELAY and IP_TOS calls; we should do it for priority as well if necessary. We also #ifdef the setting of the low-level socket priority based on whether we have a definition of SO_PRIORITY available. This option is not available on Illumos/Solaris platforms; however, since we set IP_TOS anyway it is not a big deal to omit it here.
Diffstat (limited to 'server/snd_worker.c')
-rw-r--r--server/snd_worker.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/snd_worker.c b/server/snd_worker.c
index cb64c993..e78d1d33 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -902,7 +902,9 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
SndChannel *channel;
int delay_val;
int flags;
+#ifdef SO_PRIORITY
int priority;
+#endif
int tos;
MainChannelClient *mcc = red_client_get_main(client);
@@ -911,11 +913,15 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
goto error1;
}
+#ifdef SO_PRIORITY
priority = 6;
if (setsockopt(stream->socket, SOL_SOCKET, SO_PRIORITY, (void*)&priority,
sizeof(priority)) == -1) {
- red_printf("setsockopt failed, %s", strerror(errno));
+ if (errno != ENOTSUP) {
+ red_printf("setsockopt failed, %s", strerror(errno));
+ }
}
+#endif
tos = IPTOS_LOWDELAY;
if (setsockopt(stream->socket, IPPROTO_IP, IP_TOS, (void*)&tos, sizeof(tos)) == -1) {