Blame SOURCES/elfutils-0.187-mhd_epoll.patch

83db70
commit 28f9d86ea89f88b24f1d12c8e9d5ddc3f77da194
83db70
Author: Mark Wielaard <mark@klomp.org>
83db70
Date:   Fri May 6 00:29:28 2022 +0200
83db70
83db70
    debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher
83db70
    
83db70
    Also disable MHD_USE_THREAD_PER_CONNECTION when using MHD_USE_EPOLL.
83db70
    
83db70
    https://sourceware.org/bugzilla/show_bug.cgi?id=29123
83db70
    
83db70
    Signed-off-by: Mark Wielaard <mark@klomp.org>
83db70
83db70
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
83db70
index c02540f1..d4f47bf7 100644
83db70
--- a/debuginfod/debuginfod.cxx
83db70
+++ b/debuginfod/debuginfod.cxx
83db70
@@ -1,6 +1,6 @@
83db70
 /* Debuginfo-over-http server.
83db70
    Copyright (C) 2019-2021 Red Hat, Inc.
83db70
-   Copyright (C) 2021 Mark J. Wielaard <mark@klomp.org>
83db70
+   Copyright (C) 2021, 2022 Mark J. Wielaard <mark@klomp.org>
83db70
    This file is part of elfutils.
83db70
 
83db70
    This file is free software; you can redistribute it and/or modify
83db70
@@ -3899,7 +3899,14 @@ main (int argc, char *argv[])
83db70
         }
83db70
     }
83db70
 
83db70
-  unsigned int mhd_flags = ((connection_pool
83db70
+  /* Note that MHD_USE_EPOLL and MHD_USE_THREAD_PER_CONNECTION don't
83db70
+     work together.  */
83db70
+  unsigned int use_epoll = 0;
83db70
+#if MHD_VERSION >= 0x00095100
83db70
+  use_epoll = MHD_USE_EPOLL;
83db70
+#endif
83db70
+
83db70
+  unsigned int mhd_flags = ((connection_pool || use_epoll
83db70
 			     ? 0 : MHD_USE_THREAD_PER_CONNECTION)
83db70
 #if MHD_VERSION >= 0x00095300
83db70
 			    | MHD_USE_INTERNAL_POLLING_THREAD
83db70
@@ -3907,9 +3914,7 @@ main (int argc, char *argv[])
83db70
 			    | MHD_USE_SELECT_INTERNALLY
83db70
 #endif
83db70
 			    | MHD_USE_DUAL_STACK
83db70
-#ifdef MHD_USE_EPOLL
83db70
-			    | MHD_USE_EPOLL
83db70
-#endif
83db70
+			    | use_epoll
83db70
 #if MHD_VERSION >= 0x00095200
83db70
 			    | MHD_USE_ITC
83db70
 #endif