From 17b7a76c7e40c89f31351cd1a5faf76f177b30ac Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Thu, 7 Mar 2024 08:09:16 +0100 Subject: [PATCH] Ensure `transp.reader` is reset to `nil` on error (#508) In `stream.readLoop`, a finished `Future` was left in `transp.reader` if there was an error in `resumeRead`. Set it to `nil` as well. Co-authored-by: Jacek Sieka --- chronos/transports/stream.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chronos/transports/stream.nim b/chronos/transports/stream.nim index 33a86313..fa3cbacd 100644 --- a/chronos/transports/stream.nim +++ b/chronos/transports/stream.nim @@ -2372,7 +2372,7 @@ template readLoop(name, body: untyped): untyped = # resumeRead() could not return any error. raiseOsDefect(errorCode, "readLoop(): Unable to resume reading") else: - transp.reader.complete() + transp.completeReader() if errorCode == oserrno.ESRCH: # ESRCH 3 "No such process" # This error could be happened on pipes only, when process which