diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c index cb2f1bbae..aff0a2af6 100644 --- a/lib/plat/unix/unix-sockets.c +++ b/lib/plat/unix/unix-sockets.c @@ -191,21 +191,23 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd, int unix_skt) } static const int ip_opt_lws_flags[] = { - LCCSCF_IP_LOW_LATENCY, LCCSCF_IP_HIGH_THROUGHPUT, - LCCSCF_IP_HIGH_RELIABILITY -#if !defined(__OpenBSD__) + LCCSCF_IP_LOW_LATENCY, LCCSCF_IP_HIGH_THROUGHPUT +#if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__) + , LCCSCF_IP_HIGH_RELIABILITY , LCCSCF_IP_LOW_COST #endif }, ip_opt_val[] = { - IPTOS_LOWDELAY, IPTOS_THROUGHPUT, IPTOS_RELIABILITY + IPTOS_LOWDELAY, IPTOS_THROUGHPUT #if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__) + , IPTOS_RELIABILITY , IPTOS_MINCOST #endif }; #if !defined(LWS_WITH_NO_LOGS) static const char *ip_opt_names[] = { - "LOWDELAY", "THROUGHPUT", "RELIABILITY" -#if !defined(__OpenBSD__) && !defined(__sun) + "LOWDELAY", "THROUGHPUT" +#if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__) + , "RELIABILITY" , "MINCOST" #endif }; @@ -255,7 +257,10 @@ lws_plat_set_socket_options_ip(lws_sockfd_type fd, uint8_t pri, int lws_flags) } #endif - for (n = 0; n < 4; n++) { + +#if !defined(__NuttX__) + /* array size differs by platform */ + for (n = 0; n < (int)LWS_ARRAY_SIZE(ip_opt_lws_flags); n++) { if (!(lws_flags & ip_opt_lws_flags[n])) continue; @@ -272,6 +277,7 @@ lws_plat_set_socket_options_ip(lws_sockfd_type fd, uint8_t pri, int lws_flags) lwsl_notice("%s: set ip flag %s\n", __func__, ip_opt_names[n]); } +#endif return ret; }