[Libwebsockets] [PATCH 10/11] libev: also select libev if the LWS_SERVER_OPTION_LIBEV flag is set

Andy Green andy at warmcat.com
Tue Dec 16 01:36:00 CET 2014



On 16 December 2014 07:36:31 GMT+08:00, Alejandro Mery <amery at geeks.cl> wrote:
>Signed-off-by: Alejandro Mery <amery at geeks.cl>
>---
> lib/context.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/lib/context.c b/lib/context.c
>index 884849e..f177383 100644
>--- a/lib/context.c
>+++ b/lib/context.c
>@@ -106,6 +106,14 @@ libwebsocket_create_context(struct
>lws_context_creation_info *info)
> 		return NULL;
> 	}
> 
>+	/* basic LWS_SERVER_OPTION_LIBEV compatibility */
>+	if (info->options & LWS_SERVER_OPTION_LIBEV) {
>+#ifdef LWS_USE_LIBEV
>+		info->event = LWS_EVENT_LIBEV;
>+#endif
>+		info->options &= ~LWS_SERVER_OPTION_LIBEV;
>+	}
>+

I think this should go as well... if we have n event loops no need for n chunks of this, and if user can create new event_ops in an uncontrolled way the enum and this have no meaning.

LWS_USE_LIBEV boils down to a) make the lws_event_ops_libev available and b) build the backend code.  LWS_SERVER_OPTION_LIBEV can still be compatible just change the meaning of NULL info->event_ops coming in from poll to libev.

-Andy

> 	switch (info->event) {
> #ifdef LWS_USE_LIBEV
> 	case LWS_EVENT_LIBEV:




More information about the Libwebsockets mailing list