Skip to content

Commit

Permalink
Be sure we have support for MHD_USE_EPOLL.
Browse files Browse the repository at this point in the history
Check if MHD_USE_EPOLL is supported at startup, to be sure we have a proper version of the library.
Closes #2580
  • Loading branch information
bogdan-iancu committed Aug 16, 2021
1 parent 4c3150e commit bb4de46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/httpd/doc/httpd_admin.xml
Expand Up @@ -48,7 +48,8 @@
<itemizedlist>
<listitem>
<para>
<emphasis>libmicrohttpd</emphasis>.
<emphasis>libmicrohttpd</emphasis>, with EPOLL support. This
typically mean a version newer than 0.9.50.
</para>
</listitem>
</itemizedlist>
Expand Down
9 changes: 8 additions & 1 deletion modules/httpd/httpd.c
Expand Up @@ -129,7 +129,14 @@ static int mod_init(void)
{
struct ip_addr *_ip;


/* Get whether epoll() is supported. If supported then
* Flags MHD_USE_EPOLL and MHD_USE_EPOLL_INTERNAL_THREAD can be used. */
if (MHD_is_feature_supported(MHD_FEATURE_EPOLL)!=MHD_YES) {
LM_CRIT("the version of libmicrohttpd you have does not support "
"EPOLL feature, you need a version newer than 0.9.50, but "
"running %s\n",MHD_get_version());
return -1;
}
if (ip.s) {
ip.len = strlen(ip.s);
if ( (_ip=str2ip(&ip)) == NULL ) {
Expand Down

0 comments on commit bb4de46

Please sign in to comment.