Go to file
Fiona Ebner 0ec627cff1 anyevent: disconnect: check that handle is still defined before calling shutdown()
Commit 07e56cc ("fix unexpected EOF for client when closing TLS
session") added a call to stoptls() before the call to shutdown() for
the handle's file descriptor. However, the documentation for
AnyEvent[0] mentions for stoptls():

> This method may invoke callbacks (and therefore the handle might be
> destroyed after it returns).

Therefore, it is necessary to check that the handle is still defined
before calling shutdown(). Otherwise, this can result in a warning:

> Can't use an undefined value as a symbol reference at
> /usr/share/perl5/PVE/APIServer/AnyEvent.pm line 150.

as reported in the community forum [1].

The debug print message for closing the file handle is split up,
because part of it relies on the file handle to be defined.

[0]: https://metacpan.org/pod/AnyEvent::Handle#$handle-%3Estoptls
[1]: https://forum.proxmox.com/threads/164744/

Fixes: 07e56cc ("fix unexpected EOF for client when closing TLS session")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250408142014.86344-2-f.ebner@proxmox.com
2025-04-08 16:23:46 +02:00
debian bump version to 5.2.1 2025-04-08 14:49:50 +02:00
src anyevent: disconnect: check that handle is still defined before calling shutdown() 2025-04-08 16:23:46 +02:00
.gitignore fixup no newline at end of .gitignore 2018-05-25 16:42:05 +02:00
Makefile fixup! buildsys: add sbuild target for convenience 2023-05-17 07:31:38 +02:00