context->http_proxy_address[0] = '\0';
context->options = info->options;
context->iface = info->iface;
+ context->ka_time = info->ka_time;
+ context->ka_interval = info->ka_interval;
+ context->ka_probes = info->ka_probes;
+
/* to reduce this allocation, */
context->max_fds = getdtablesize();
lwsl_notice(" static allocation: %u + (%u x %u fds) = %u bytes\n",
" per-conn mem: %u + %u headers + protocol rx buf\n",
sizeof(struct libwebsocket),
sizeof(struct allocated_headers));
-
+
if (lws_context_init_server_ssl(info, context))
goto bail;
-
+
if (lws_context_init_client_ssl(info, context))
goto bail;
#else
/* set the keepalive conditions we want on it too */
optval = context->ka_time;
- if (setsockopt(fd, IPPROTO_IP, TCP_KEEPIDLE,
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE,
(const void *)&optval, optlen) < 0)
return 1;
optval = context->ka_interval;
- if (setsockopt(fd, IPPROTO_IP, TCP_KEEPINTVL,
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL,
(const void *)&optval, optlen) < 0)
return 1;
optval = context->ka_probes;
- if (setsockopt(fd, IPPROTO_IP, TCP_KEEPCNT,
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT,
(const void *)&optval, optlen) < 0)
return 1;
#endif
lwsl_warn("setgid: %s\n", strerror(LWS_ERRNO));
if (info->uid != -1)
if (setuid(info->uid))
- lwsl_warn("setuid: %s\n", strerror(LWS_ERRNO));
+ lwsl_warn("setuid: %s\n", strerror(LWS_ERRNO));
}
LWS_VISIBLE int
context->fds[0].events = LWS_POLLIN;
context->fds[0].revents = 0;
context->fds_count = 1;
-
+
context->fd_random = open(SYSTEM_RANDOM_FILEPATH, O_RDONLY);
if (context->fd_random < 0) {
lwsl_err("Unable to open random device %s %d\n",
sigaddset(&mask, SIGUSR2);
sigprocmask(SIG_BLOCK, &mask, NULL);
-
+
signal(SIGPIPE, sigpipe_handler);
return 0;
}
freeifaddrs(ifr);
-
+
if (rc == -1) {
/* check if bind to IP adddress */
#ifdef LWS_USE_IPV6
#ifdef LWS_USE_IPV6
LWS_VISIBLE const char *
lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt)
-{
+{
return inet_ntop(af, src, dst, cnt);
}
#endif