From 3f2d6c4cd9581790b33810059c91870f2367c698 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Fri, 28 Mar 2014 09:28:13 +0100 Subject: [PATCH] Remove duplicated code for setting the socket options --- lib/libwebsockets.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index c27ebb2b59..fbc0faed02 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -2598,17 +2598,7 @@ libwebsocket_create_context(struct lws_context_creation_info *info) setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&opt, sizeof(opt)); - /* Disable Nagle */ - opt = 1; - setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, - (const void *)&opt, sizeof(opt)); - - #if defined(WIN32) || defined(_WIN32) - opt = 0; - ioctlsocket(sockfd, FIONBIO, (unsigned long *)&opt); - #else - fcntl(sockfd, F_SETFL, O_NONBLOCK); - #endif + lws_set_socket_options(context, sockfd); #ifdef LWS_USE_IPV6 if (LWS_IPV6_ENABLED(context)) {