From 6740b70aaf12bf989cbe9b109861e0d45c62a1b8 Mon Sep 17 00:00:00 2001 From: Andrew Canaday Date: Sun, 26 Apr 2015 22:56:42 -0400 Subject: [PATCH] Set default libev-related SIGINT handling at context create to avoid breaking backwards compatibility with existing deploys. --- lib/context.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/context.c b/lib/context.c index f1c8dd0..b17e900 100644 --- a/lib/context.c +++ b/lib/context.c @@ -297,6 +297,17 @@ libwebsocket_context_destroy(struct libwebsocket_context *context) n--; } +#ifdef LWS_USE_LIBEV + /* (Issue #264) In order to *avoid breaking backwards compatibility*, we + * enable libev mediated SIGINT handling with a default handler of + * libwebsocket_sigint_cb. The handler can be overridden or disabled + * by invoking libwebsocket_sigint_cfg after creating the context, but + * before invoking libwebsocket_initloop: + */ + context->use_ev_sigint = 1; + context->lws_ev_sigint_cb = &libwebsocket_sigint_cb; +#endif /* LWS_USE_LIBEV */ + /* * give all extensions a chance to clean up any per-context * allocations they might have made -- 2.7.4