]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher
authorMark Wielaard <mark@klomp.org>
Thu, 5 May 2022 22:29:28 +0000 (00:29 +0200)
committerMark Wielaard <mark@klomp.org>
Wed, 11 May 2022 22:58:22 +0000 (00:58 +0200)
Also disable MHD_USE_THREAD_PER_CONNECTION when using MHD_USE_EPOLL.

https://sourceware.org/bugzilla/show_bug.cgi?id=29123

Signed-off-by: Mark Wielaard <mark@klomp.org>
debuginfod/ChangeLog
debuginfod/debuginfod.cxx

index 29480c9c9e33066d7c46988fc0a376a2f039c16d..1c5cd4e212726b17671ceab579665eac2cf442c8 100644 (file)
@@ -1,3 +1,9 @@
+2022-05-05  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod.cxx (main): Define use_epoll. Set to MHD_USE_EPOLL
+       based on MHD_VERSION. Don't use MHD_USE_THREAD_PER_CONNECTION
+       when use_poll is set.
+
 2022-05-05  Mark Wielaard  <mark@klomp.org>
 
        * debuginfod.cxx (main): Define mhd_flags. Use mhd_flags for
index 8692a424ef1de4b8391a3296068ad585b69f7402..e7ea356cae22a60f089a9ba230878d8381ea91e1 100644 (file)
@@ -1,6 +1,6 @@
 /* Debuginfo-over-http server.
    Copyright (C) 2019-2021 Red Hat, Inc.
-   Copyright (C) 2021 Mark J. Wielaard <mark@klomp.org>
+   Copyright (C) 2021, 2022 Mark J. Wielaard <mark@klomp.org>
    This file is part of elfutils.
 
    This file is free software; you can redistribute it and/or modify
@@ -3906,7 +3906,14 @@ main (int argc, char *argv[])
         }
     }
 
-  unsigned int mhd_flags = ((connection_pool
+  /* Note that MHD_USE_EPOLL and MHD_USE_THREAD_PER_CONNECTION don't
+     work together.  */
+  unsigned int use_epoll = 0;
+#if MHD_VERSION >= 0x00095100
+  use_epoll = MHD_USE_EPOLL;
+#endif
+
+  unsigned int mhd_flags = ((connection_pool || use_epoll
                             ? 0 : MHD_USE_THREAD_PER_CONNECTION)
 #if MHD_VERSION >= 0x00095300
                            | MHD_USE_INTERNAL_POLLING_THREAD
@@ -3914,9 +3921,7 @@ main (int argc, char *argv[])
                            | MHD_USE_SELECT_INTERNALLY
 #endif
                            | MHD_USE_DUAL_STACK
-#ifdef MHD_USE_EPOLL
-                           | MHD_USE_EPOLL
-#endif
+                           | use_epoll
 #if MHD_VERSION >= 0x00095200
                            | MHD_USE_ITC
 #endif