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 e975bae1e6
commit 0a5a701cfc

View file

@ -563,6 +563,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)
@ -571,6 +576,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)
@ -579,6 +589,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)
@ -587,6 +602,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)
@ -595,6 +615,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)
@ -603,6 +628,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 */