From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id AC4D01FF0B2 for ; Mon, 24 Aug 2026 10:58:22 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8FC66216B6; Mon, 24 Aug 2026 10:57:23 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH cluster 09/12] pmxcfs: server: simplify message response size calculation Date: Mon, 24 Aug 2026 10:56:08 +0200 Message-ID: <20260824085610.111211-11-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260824085610.111211-2-d.kral@proxmox.com> References: <20260824085610.111211-2-d.kral@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787561806536 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.912 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NZREVY5I6RUPI5IZ76B6E3CAZAS2NNFS X-Message-ID-Hash: NZREVY5I6RUPI5IZ76B6E3CAZAS2NNFS X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Calculate the full message size by the actual length of the iovecs, which are copied over memory to remove some small code duplication. No functional changes intended. Signed-off-by: Daniel Kral --- src/pmxcfs/server.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pmxcfs/server.c b/src/pmxcfs/server.c index 0af6745..c53d4e0 100644 --- a/src/pmxcfs/server.c +++ b/src/pmxcfs/server.c @@ -456,15 +456,15 @@ static void s1_msg_send_response(qb_ipcs_connection_t *c, int32_t request_id, in g_string_truncate(outbuf, 0); } - res_header.id = request_id; - res_header.size = sizeof(res_header) + outbuf->len; - res_header.error = result; - iov[0].iov_base = (char *)&res_header; iov[0].iov_len = sizeof(res_header); iov[1].iov_base = outbuf->str; iov[1].iov_len = outbuf->len; + res_header.id = request_id; + res_header.size = iov[0].iov_len + iov[1].iov_len; + res_header.error = result; + ssize_t res = qb_ipcs_response_sendv(c, iov, iov_len); if (res < 0) { cfs_critical("qb_ipcs_response_send: %s", strerror(errno)); -- 2.47.3