From 2ef766a740bf96c1ec8edd8d0060ebea1db8eca7 Mon Sep 17 00:00:00 2001 From: Alex Kremer Date: Wed, 4 Oct 2023 16:59:40 +0100 Subject: [PATCH] Fixes broken counters for broken pipe connections (#880) Fixes #885 --- src/web/impl/WsBase.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/web/impl/WsBase.h b/src/web/impl/WsBase.h index e1e51d857..ded75086a 100644 --- a/src/web/impl/WsBase.h +++ b/src/web/impl/WsBase.h @@ -121,6 +121,10 @@ public: void maybeSendNext() { + // cleanup if needed. can't do this in destructor so it's here + if (dead()) + (*handler_)(ec_, derived().shared_from_this()); + if (ec_ || sending_ || messages_.empty()) return;