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: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C2E1A1F565 for ; Mon, 4 Sep 2023 06:22:36 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=80x24.org header.i=@80x24.org header.a=rsa-sha256 header.s=selector1 header.b=1W/OqdTw; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qd2yi-0007Q8-LA; Mon, 04 Sep 2023 02:22:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qd2yd-0007Ph-KV for dtas-all@nongnu.org; Mon, 04 Sep 2023 02:22:24 -0400 Received: from dcvr.yhbt.net ([173.255.242.215]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qd2yb-0008BP-2l for dtas-all@nongnu.org; Mon, 04 Sep 2023 02:22:23 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 256031F55F for ; Mon, 4 Sep 2023 06:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1693808540; bh=DQUZcK7BLbfZBuPram0lDtSbtaiNR/F2DysQ7OjJfp0=; h=From:To:Subject:Date:From; b=1W/OqdTwVNX5Qz8lv64vZgnw0vycakonn62OOvHcW5tLmg8CeXZdTlt3lBQhFeY1S bjDK74hgTPmQ9zwprREPf4O41NLwPbITUIfIBRUEgxUIBraW6xJDGg2DF3ERwk5MBA EYo40hrS9/LxcdsDF1vhVTYYlfPRWrNzec7d2VL0= From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH] drop MSG_EOR for AF_UNIX + SOCK_SEQPACKET Date: Mon, 4 Sep 2023 06:22:19 +0000 Message-ID: <20230904062220.2054739-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=173.255.242.215; envelope-from=e@80x24.org; helo=dcvr.yhbt.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: dtas-all-bounces+e=80x24.org@nongnu.org Using MSG_EOR with these local sockets is not necessary, and appears to trigger a truncation bug on OpenBSD 7.3. Link: https://marc.info/?i=20230826020759.M335788@dcvr --- lib/dtas/player/client_handler.rb | 2 +- lib/dtas/unix_accepted.rb | 4 ++-- lib/dtas/unix_client.rb | 2 +- test/test_unixserver.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb index 2914fe7..3c5fe5d 100644 --- a/lib/dtas/player/client_handler.rb +++ b/lib/dtas/player/client_handler.rb @@ -564,7 +564,7 @@ def state_file_dump_async(io, sf) rescue => e res = "ERR dumping to #{xs(sf.path)} #{e.message}" end - io.to_io.send(res, Socket::MSG_EOR) + io.to_io.send(res, 0) ensure exit!(0) end diff --git a/lib/dtas/unix_accepted.rb b/lib/dtas/unix_accepted.rb index a84eade..63d3ce0 100644 --- a/lib/dtas/unix_accepted.rb +++ b/lib/dtas/unix_accepted.rb @@ -17,7 +17,7 @@ def initialize(sock) # returns :wait_readable on success def emit(msg) if @sbuf.empty? - case rv = @to_io.sendmsg_nonblock(msg, Socket::MSG_EOR, exception: false) + case rv = @to_io.sendmsg_nonblock(msg, 0, exception: false) when :wait_writable @sbuf << msg rv @@ -34,7 +34,7 @@ def emit(msg) # flushes pending data if it got buffered def writable_iter - case @to_io.sendmsg_nonblock(@sbuf[0], Socket::MSG_EOR, exception: false) + case @to_io.sendmsg_nonblock(@sbuf[0], 0, exception: false) when :wait_writable then return :wait_writable else @sbuf.shift diff --git a/lib/dtas/unix_client.rb b/lib/dtas/unix_client.rb index 71f833c..8c73b7d 100644 --- a/lib/dtas/unix_client.rb +++ b/lib/dtas/unix_client.rb @@ -24,7 +24,7 @@ def initialize(path = self.class.default_path) def req_start(args) args = xs(args) if Array === args - @to_io.send(args, Socket::MSG_EOR) + @to_io.send(args, 0) end def req_ok(args, timeout = nil) diff --git a/test/test_unixserver.rb b/test/test_unixserver.rb index 7e99b9e..c91354d 100644 --- a/test/test_unixserver.rb +++ b/test/test_unixserver.rb @@ -41,7 +41,7 @@ def test_server_loop @srv.run_once # nothing msgs = [] clients = [] - client.send("HELLO", Socket::MSG_EOR) + client.send("HELLO", 0) @srv.run_once do |c, msg| clients << c msgs << msg