diff options
Diffstat (limited to 'server/snd_worker.c')
-rw-r--r-- | server/snd_worker.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/server/snd_worker.c b/server/snd_worker.c index 0527009e..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,20 +913,28 @@ 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) { - red_printf("setsockopt failed, %s", strerror(errno)); + if (errno != ENOTSUP) { + red_printf("setsockopt failed, %s", strerror(errno)); + } } delay_val = main_channel_client_is_low_bandwidth(mcc) ? 0 : 1; if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY, &delay_val, sizeof(delay_val)) == -1) { - red_printf("setsockopt failed, %s", strerror(errno)); + if (errno != ENOTSUP) { + red_printf("setsockopt failed, %s", strerror(errno)); + } } if (fcntl(stream->socket, F_SETFL, flags | O_NONBLOCK) == -1) { |