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 CD1921FF0AB for ; Wed, 09 Sep 2026 14:03:24 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 204C721636; Wed, 09 Sep 2026 14:03:16 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Subject: [PATCH http-server 2/2] websocket: include close reason in debug log Date: Wed, 9 Sep 2026 14:03:06 +0200 Message-ID: <20260909120309.432116-2-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260909120309.432116-1-f.gruenbichler@proxmox.com> References: <20260909120309.432116-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788955383360 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.835 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: E75BO3OTTLYVFC3GSHP4BTP55W3CW5UN X-Message-ID-Hash: E75BO3OTTLYVFC3GSHP4BTP55W3CW5UN X-MailFrom: f.gruenbichler@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: if given by the client. Signed-off-by: Fabian Grünbichler --- src/PVE/APIServer/AnyEvent.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm index 12701aa..44e4568 100644 --- a/src/PVE/APIServer/AnyEvent.pm +++ b/src/PVE/APIServer/AnyEvent.pm @@ -678,7 +678,9 @@ sub websocket_proxy { $self->dprint("websocket received close with too short payload: $payload_len"); } else { my $statuscode = unpack("n", $payload); - $self->dprint("websocket received close. status code: '$statuscode'"); + my $reason = substr($payload, 2, $payload_len - 2); + $reason = '-' if !$reason; + $self->dprint("websocket received close. status code: '$statuscode', reason: '$reason'"); } if (my $proxyhdl = $reqstate->{proxyhdl}) { $proxyhdl->{block_disconnect} = 1 if length $proxyhdl->{wbuf}; -- 2.47.3