From nobody Sat Jul 22 12:37:59 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Qtv6W3nz4nxMp; Sat, 22 Jul 2023 12:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7Qtv62Rnz4NKr; Sat, 22 Jul 2023 12:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690029479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qr5SJw0z0GMkZpr2VxMSboySUXu/L2uyzekBmBs/MHE=; b=x9H8s94P5pkm/30XCFNOMhkldLAyy2m5DMr04MDaymqSpI1cZZEKBGugat4/ueHxToviGf SRsDMWE6BRnHYyneZ+Z413Y2sco01pyEYTdxxyKQDQ5cFrVd3drCraF7SC8T7QstsxMIUY S2DjHiH+h8JfwkkqJbV2+NgAIjA9G0STgLFpxcn5mxklEuBWhbxwFuWzLF9HEwODHjv6xK yTcUSlzTEzYe76RxChFx8jlge6QI2w/ha6ciT9sQckYCKMwTsDEPYySJV4iKhucJqtHHms 7XmST/+Ok1VA7ithmMXHLQuQXxFOIfBn3rOp23iBSvwMDP2+DBMojYk2HNZgCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690029479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qr5SJw0z0GMkZpr2VxMSboySUXu/L2uyzekBmBs/MHE=; b=b5fVz4xpKPP51EVt5bxiRTFEami++AvD7BT03Lz4LDHCthHky1ak2A5KG3M3mrip375wjp GA5GWZ7WUzQo9BgtlOU88JEz5AkEDVVDMiRwtz9ukKo6mPlJYlzWNng7xiDpHeaN0dHP6X xQ19T7nVwnca+yAR8ljSWNJuoKhfudokGQS4AJ7EgE7DZ03OleeLpZI/3pzUjLUwg7ikh1 A8XKBQvz3t1r1U7CSbFDEMgCUoi2YEol+P84pFecJI8Gi+OV6oTk05yX8csmhMgc9+YizT nFCMv00jUpDDamw619f9/eldHuSVXHOzxbkIAkFtrwL4wnECBF9CXZFxFiJDig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690029479; a=rsa-sha256; cv=none; b=OEfX7aMuE2+w1k+GCK16pWHXvOnjWQmNUxGcBp10CRk0XOr7+D8+w07kT/Fi3SiArJVNoO 3IGPXssl3aH0Q5wxMABkEm052X58NQ5vFDgklQtsd/TmDdNJUosRa8deSRERQ5qhnkklQE 8a57+iP+yfaCF/WAizNfX3vUF3a6d1lCJPjIPGFx/GQdwKmHB3feM4oRVfK9gaGmD1qRxA H1fqc0ip/dyNKeJU037fmIMjBWuIWFJT3BnOqHq7m7IBdCYByVuXPvsW4RvUxUTaTJkOIG LxV9SlxZDnEluddvWLUF1hBol//ISqTyCD4q3PKoClGEtsot8yq5u6e6Jq+azw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7Qtv54yszv4j; Sat, 22 Jul 2023 12:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MCbxur097180; Sat, 22 Jul 2023 12:37:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MCbxOQ097179; Sat, 22 Jul 2023 12:37:59 GMT (envelope-from git) Date: Sat, 22 Jul 2023 12:37:59 GMT Message-Id: <202307221237.36MCbxOQ097179@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Doug Rabson Subject: git: 12a219fc28ea - main - sysutils/conmon: fix socket buffering for console i/o List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12a219fc28ea2cb5c9ee67abc222646a424cc9bb Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/ports/commit/?id=12a219fc28ea2cb5c9ee67abc222646a424cc9bb commit 12a219fc28ea2cb5c9ee67abc222646a424cc9bb Author: Doug Rabson AuthorDate: 2023-07-07 12:07:37 +0000 Commit: Doug Rabson CommitDate: 2023-07-22 12:36:46 +0000 sysutils/conmon: fix socket buffering for console i/o Approved by: lwhsu --- sysutils/conmon/Makefile | 2 +- sysutils/conmon/files/patch-src_conn__sock.c | 44 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/sysutils/conmon/Makefile b/sysutils/conmon/Makefile index 5114574ede56..ebd4733aa269 100644 --- a/sysutils/conmon/Makefile +++ b/sysutils/conmon/Makefile @@ -1,7 +1,7 @@ PORTNAME= conmon DISTVERSIONPREFIX= v DISTVERSION= 2.1.7 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MAINTAINER= dfr@FreeBSD.org diff --git a/sysutils/conmon/files/patch-src_conn__sock.c b/sysutils/conmon/files/patch-src_conn__sock.c new file mode 100644 index 000000000000..f033e0fb88dd --- /dev/null +++ b/sysutils/conmon/files/patch-src_conn__sock.c @@ -0,0 +1,44 @@ +--- src/conn_sock.c.orig 2023-07-07 12:04:59 UTC ++++ src/conn_sock.c +@@ -110,6 +110,14 @@ static void bind_relative_to_dir(int dir_fd, int sock_ + if (bind(sock_fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) + pexit("Failed to bind to console-socket"); + } ++ ++static void set_socket_buffers(G_GNUC_UNUSED int fd) ++{ ++ /* ++ * Nothing needed here for Linux - the default buffer sizes for unix domain sockets are large enough. ++ */ ++} ++ + #endif + + #ifdef __FreeBSD__ +@@ -135,6 +143,18 @@ static void bind_relative_to_dir(int dir_fd, int sock_ + if (fchmodat(dir_fd, addr.sun_path, 0700, AT_SYMLINK_NOFOLLOW)) + pexit("Failed to change console-socket permissions"); + } ++ ++static void set_socket_buffers(int fd) ++{ ++ int sz = CONN_SOCK_BUF_SIZE; ++ if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz))) { ++ nwarn("failed to set socket receive buffer size"); ++ } ++ if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sz, sizeof(sz))) { ++ nwarn("failed to set socket send buffer size"); ++ } ++} ++ + #endif + + static char *setup_socket(int *fd, const char *path) +@@ -357,6 +377,7 @@ static gboolean attach_cb(int fd, G_GNUC_UNUSED GIOCon + nwarn("Failed to accept client connection on attach socket"); + } else { + struct remote_sock_s *remote_sock; ++ set_socket_buffers(new_fd); + if (srcsock->dest->readers == NULL) { + srcsock->dest->readers = g_ptr_array_new_with_free_func(free); + }