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 <jacek@status.im>
This commit is contained in:
Etan Kissling 2024-03-07 08:09:16 +01:00 committed by GitHub
parent c5a5ece487
commit 17b7a76c7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -2372,7 +2372,7 @@ template readLoop(name, body: untyped): untyped =
# resumeRead() could not return any error. # resumeRead() could not return any error.
raiseOsDefect(errorCode, "readLoop(): Unable to resume reading") raiseOsDefect(errorCode, "readLoop(): Unable to resume reading")
else: else:
transp.reader.complete() transp.completeReader()
if errorCode == oserrno.ESRCH: if errorCode == oserrno.ESRCH:
# ESRCH 3 "No such process" # ESRCH 3 "No such process"
# This error could be happened on pipes only, when process which # This error could be happened on pipes only, when process which