1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

event: blow error if runtime context options want eventlib we dont have

https://github.com/warmcat/libwebsockets/issues/3186
This commit is contained in:
Andy Green 2024-09-25 09:03:17 +01:00
parent 2ca5d8605b
commit 8fc7596fec

View file

@ -542,6 +542,11 @@ lws_create_context(const struct lws_context_creation_info *info)
fatal_exit_defer = !!info->foreign_loops;
us_wait_resolution = 0;
}
#else
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBUV)) {
lwsl_cx_err(context, "Application wants libuv, but lws not built with it");
goto bail;
}
#endif
#if defined(LWS_WITH_LIBEVENT)
@ -550,6 +555,11 @@ lws_create_context(const struct lws_context_creation_info *info)
plev = &evlib_event;
us_wait_resolution = 0;
}
#else
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEVENT)) {
lwsl_cx_err(context, "Application wants libevent, but lws not built with it");
goto bail;
}
#endif
#if defined(LWS_WITH_GLIB)
@ -558,6 +568,11 @@ lws_create_context(const struct lws_context_creation_info *info)
plev = &evlib_glib;
us_wait_resolution = 0;
}
#else
if (lws_check_opt(info->options, LWS_SERVER_OPTION_GLIB)) {
lwsl_cx_err(context, "Application wants glib, but lws not built with it");
goto bail;
}
#endif
#if defined(LWS_WITH_LIBEV)
@ -566,6 +581,11 @@ lws_create_context(const struct lws_context_creation_info *info)
plev = &evlib_ev;
us_wait_resolution = 0;
}
#else
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEV)) {
lwsl_cx_err(context, "Application wants libev, but lws not built with it");
goto bail;
}
#endif
#if defined(LWS_WITH_SDEVENT)
@ -574,6 +594,11 @@ lws_create_context(const struct lws_context_creation_info *info)
plev = &evlib_sd;
us_wait_resolution = 0;
}
#else
if (lws_check_opt(info->options, LWS_SERVER_OPTION_SDEVENT)) {
lwsl_cx_err(context, "Application wants sdevent, but lws not built with it");
goto bail;
}
#endif
#if defined(LWS_WITH_ULOOP)
@ -582,6 +607,11 @@ lws_create_context(const struct lws_context_creation_info *info)
plev = &evlib_uloop;
us_wait_resolution = 0;
}
#else
if (lws_check_opt(info->options, LWS_SERVER_OPTION_ULOOP)) {
lwsl_cx_err(context, "Application wants uloop, but lws not built with it");
goto bail;
}
#endif
#endif /* with event libs */