From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 4528D385736C for ; Thu, 5 May 2022 22:38:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4528D385736C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x07.wildebeest.org [172.31.17.137]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 40CED3000340; Fri, 6 May 2022 00:38:43 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 283562E823B5; Fri, 6 May 2022 00:38:43 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher Date: Fri, 6 May 2022 00:38:40 +0200 Message-Id: <20220505223840.565602-1-mark@klomp.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 22:38:45 -0000 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 --- debuginfod/ChangeLog | 6 ++++++ debuginfod/debuginfod.cxx | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index e108f847..ce93a9f0 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,9 @@ +2022-05-05 Mark Wielaard + + * 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 * debuginfod.cxx (main): Define mhd_flags. Use mhd_flags for diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index c02540f1..d4f47bf7 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -1,6 +1,6 @@ /* Debuginfo-over-http server. Copyright (C) 2019-2021 Red Hat, Inc. - Copyright (C) 2021 Mark J. Wielaard + Copyright (C) 2021, 2022 Mark J. Wielaard This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -3899,7 +3899,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 @@ -3907,9 +3914,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 -- 2.30.2