From 52b28bbb7791681b0a8a03808ba0fe1b8d4d2a3d Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 15 May 2026 22:47:39 -0400 Subject: [PATCH] Use websocket_closed for detection of client stop, comments. --- src/net/proxy.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/net/proxy.cpp b/src/net/proxy.cpp index 5e67212d1..8f948b18d 100644 --- a/src/net/proxy.cpp +++ b/src/net/proxy.cpp @@ -52,14 +52,10 @@ void proxy::stop(const code& ec) NOEXCEPT if (stopped()) return; - // Client or timer initated stop is async (graceful). - // error::channel_stopped is send in various contexts, however the only - // ones in which the channel is not stopped are those arising directly from - // socket read handlers, resulting in a stop(ec) call. This is interpreted - // as client socket cancellation, which along with timer cancellations are - // allowed to close gracefully. error::service_stopped will invoke socket - // stop() below, which will immediately terminate outstanding lazy_stop(). - if (ec == error::channel_stopped || + // Client websocket or timer initated (when ws) stop is async (graceful). + // error::service_stopped will invoke socket stop() below, which will + // immediately terminate outstanding lazy_stop(). + if (ec == error::websocket_closed || ec == error::channel_expired || ec == error::channel_inactive) {