]> git.proxmox.com Git - pve-http-server.git/commit
accept-phase: shutdown socket on early error
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 10 Dec 2020 14:02:50 +0000 (15:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 10 Dec 2020 19:23:38 +0000 (20:23 +0100)
commitebcaaf4606234a259120cd6f1d59e66979e3065c
tree5f4b8697101351899bf66bb65f557a1ba9581a4b
parentc82d1707ed3ba7de58161842d62a2b177308982a
accept-phase: shutdown socket on early error

if an error happens before AnyEvent::Handle registers the cleanup
callback, we should shutdown/close the socket, when handling it.

Using close, instead of shutdown($sock, SHUT_WR) here, since we are in
an error-state, and would not read from the socket anyways.
(Additionally close sends just on packet (RST,ACK), vs shutdown
(FIN,ACK+RST,ACK) in its use here).

Co-Authored-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/APIServer/AnyEvent.pm