keepalive swap interval and probes 34/3134/1
authorLarry Hayes <lhayesg@gmail.com>
Fri, 22 Feb 2013 01:16:20 +0000 (09:16 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:37 +0000 (13:01 -0800)
The interval and probes members for setting keepalive options
per-connection on Linux were swapped.

Signed-off-by: Larry Hayes <lhayesg@gmail.com>
lib/libwebsockets.c

index 8756de7..a4d352c 100644 (file)
@@ -578,12 +578,12 @@ int lws_set_socket_options(struct libwebsocket_context *context, int fd)
                                             (const void *)&optval, optlen) < 0)
                        return 1;
 
-               optval = context->ka_probes;
+               optval = context->ka_interval;
                if (setsockopt(fd, IPPROTO_IP, TCP_KEEPINTVL,
                                             (const void *)&optval, optlen) < 0)
                        return 1;
 
-               optval = context->ka_interval;
+               optval = context->ka_probes;
                if (setsockopt(fd, IPPROTO_IP, TCP_KEEPCNT,
                                             (const void *)&optval, optlen) < 0)
                        return 1;