From a3b9d4731f8f262c0eb0bfab73c0729884fa641f Mon Sep 17 00:00:00 2001 From: pajama-coder Date: Wed, 6 Dec 2023 16:48:35 +0800 Subject: [PATCH] [fix] Fixed a crash caused by a connection failure StreamEnd happening after a pipeline reset --- src/outbound.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/outbound.cpp b/src/outbound.cpp index acbd556be..239f77bd4 100644 --- a/src/outbound.cpp +++ b/src/outbound.cpp @@ -103,8 +103,10 @@ auto Outbound::address() -> pjs::Str* { void Outbound::close(StreamEnd *eos) { InputContext ic; - close(); + retain(); input(eos); + close(); + release(); } void Outbound::state(State state) { @@ -117,7 +119,9 @@ void Outbound::state(State state) { } void Outbound::input(Event *evt) { - m_input->input(evt); + if (m_state != State::closed) { + m_input->input(evt); + } } void Outbound::error(StreamEnd::Error err) {