From bb66ac6ec13092d5f7ef2f8a199605fc95e25cba Mon Sep 17 00:00:00 2001 From: Larry Hayes Date: Fri, 22 Feb 2013 09:16:20 +0800 Subject: [PATCH] keepalive swap interval and probes The interval and probes members for setting keepalive options per-connection on Linux were swapped. Signed-off-by: Larry Hayes --- lib/libwebsockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 8756de7f..a4d352c7 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -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;