public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH pve-http-server 1/1] close TLS gracefully to avoid unexpected EOF at client
Date: Thu, 27 Feb 2025 10:35:47 +0100 (CET)	[thread overview]
Message-ID: <2000809141.1573.1740648947275@webmail.proxmox.com> (raw)
In-Reply-To: <mailman.598.1740610963.293.pve-devel@lists.proxmox.com>


> Rob Rozestraten via pve-devel <pve-devel@lists.proxmox.com> hat am 26.02.2025 23:51 CET geschrieben:

Hi (and thanks for your patch)!

A little bit of analysis of *why* this is needed and okay would be great to have here in the commit message ;)

If I read the docs right, this could block (would that be an issue here?) and could potentially destroy the handle (so that might need to be rechecked afterwards to prevent spurious warnings?)

what happens if we initiate the teardown, and the client never acks it?

> Signed-off-by: Rob Rozestraten <admin@truthsolo.net>
> ---
>  src/PVE/APIServer/AnyEvent.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm
> index 8a52836..771b153 100644
> --- a/src/PVE/APIServer/AnyEvent.pm
> +++ b/src/PVE/APIServer/AnyEvent.pm
> @@ -141,6 +141,7 @@ sub client_do_disconnect {
>      my $shutdown_hdl = sub {
>  	my $hdl = shift;
>  
> +	$hdl->stoptls() if $hdl->{tls};

nit: the if is not needed, as `stoptls` only does anything anyway if $hdl has a FH and is a TLS-enabled handle ;)

>  	shutdown($hdl->{fh}, 1);
>  	# clear all handlers
>  	$hdl->on_drain(undef);
> -- 
> 2.48.1


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      reply	other threads:[~2025-02-27  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250226225126.346918-1-admin@truthsolo.net>
2025-02-26 22:51 ` Rob Rozestraten via pve-devel
2025-02-27  9:35   ` Fabian Grünbichler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2000809141.1573.1740648947275@webmail.proxmox.com \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal