From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DF0EB1F406 for ; Tue, 17 Oct 2023 23:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1697585895; bh=KBwhNwaiRnztxQB9CrNSFHvmmgb5M1oBsJLvXI6wAWo=; h=From:To:Subject:Date:From; b=S8sY4hggx+zvNR0E2cJWO1HDAcxFKHoSNu4Wa9ysnStC/HyDTOMTOvFnwYs8Q5PT2 cb9SgxQMkzYIbu2e37yPfg42nZ6wKnjQBbyDnUJzkbrCkxdy2+ajzbG9mWF9NjvIRC J8zPVK9dSCQTmYjg476GqqTopsFydI96RAl9Vte8= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 00/30] autodie-ification and code simplifications Date: Tue, 17 Oct 2023 23:37:45 +0000 Message-ID: <20231017233815.1637932-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Noisy code is less pleasant to work on, so use autodie more and a few more simplifications. There's a couple of small bugfixes discovered along the way, too. Eric Wong (30): lei_mirror: start converting to autodie lei_mirror: autodie most `close' calls lei_mirror: use autodie for most `open' calls git: introduce read_all function import: use read_all to detect short reads lei_mirror: use read_all use read_all in more places to improve safety xap_helper*: use autodie in more places xap_helper: die more easily in both implementations xap_helper: simplify SIGTERM exit checks xap_helper: autodie for getsockopt xap_client: autodie for pipe and socketpair xt/git-http-backend: remove Net::HTTP usage ds: introduce and use do_fork helper ds: get rid of SetLoopTimeout cindex: drop some unused functions syscall: common $F_SETPIPE_SZ definition t/lei-up: additional diagnostics for match failures test_common: use autodie and read_all where possible test_common: only hide TCP port in messages test_common: use $cwdfh for every run_script command init: drop extraneous `+' init: use autodie to reduce distractions xt/mem-imapd-tls: remove unused/broken epoll imports xt/mem-imapd-tls: reduce FDs for lsof use lei: use autodie where appropriate lei_auth: update comments and use v5.12 lei_config: drop redundant open check convert: use read_all to simplify error checks idx_stack: use autodie + read_all lib/PublicInbox/CidxLogP.pm | 4 +- lib/PublicInbox/CodeSearchIdx.pm | 5 -- lib/PublicInbox/DS.pm | 36 ++++---- lib/PublicInbox/Daemon.pm | 16 ++-- lib/PublicInbox/EOFpipe.pm | 6 +- lib/PublicInbox/Gcf2.pm | 7 +- lib/PublicInbox/Git.pm | 19 +++-- lib/PublicInbox/IPC.pm | 12 +-- lib/PublicInbox/IdxStack.pm | 20 ++--- lib/PublicInbox/Import.pm | 8 +- lib/PublicInbox/InboxWritable.pm | 6 +- lib/PublicInbox/LEI.pm | 48 +++++------ lib/PublicInbox/LeiALE.pm | 11 +-- lib/PublicInbox/LeiAuth.pm | 7 +- lib/PublicInbox/LeiBlob.pm | 6 +- lib/PublicInbox/LeiConfig.pm | 4 +- lib/PublicInbox/LeiMailSync.pm | 5 +- lib/PublicInbox/LeiMirror.pm | 131 ++++++++++++++---------------- lib/PublicInbox/LeiSucks.pm | 5 +- lib/PublicInbox/LeiXSearch.pm | 2 +- lib/PublicInbox/MultiGit.pm | 3 +- lib/PublicInbox/SearchIdxShard.pm | 14 ++-- lib/PublicInbox/Syscall.pm | 16 ++-- lib/PublicInbox/TestCommon.pm | 85 +++++++++---------- lib/PublicInbox/ViewVCS.pm | 12 ++- lib/PublicInbox/WWW.pm | 4 +- lib/PublicInbox/Watch.pm | 11 +-- lib/PublicInbox/XapClient.pm | 11 +-- lib/PublicInbox/XapHelper.pm | 24 ++---- lib/PublicInbox/XapHelperCxx.pm | 11 +-- lib/PublicInbox/Xapcmd.pm | 5 +- lib/PublicInbox/xap_helper.h | 60 ++++++-------- script/public-inbox-convert | 8 +- script/public-inbox-edit | 4 +- script/public-inbox-init | 30 +++---- t/dir_idle.t | 2 +- t/ds-leak.t | 4 +- t/gcf2.t | 5 +- t/init.t | 7 ++ t/lei-sigpipe.t | 7 +- t/lei-up.t | 4 +- xt/git-http-backend.t | 30 +++---- xt/mem-imapd-tls.t | 21 ++--- xt/mem-nntpd-tls.t | 8 +- 44 files changed, 335 insertions(+), 409 deletions(-)