about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-12 14:08:03 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-12 14:08:03 +0100
commit2ac31dd859c84697d108c88dd1b22b5ffa5beb95 (patch)
treece58ea045d9670730386deb7a724c702a4bebdc6 /src
parent75865752dd0e0db44916fa493b78e3761279359c (diff)
downloadchawan-2ac31dd859c84697d108c88dd1b22b5ffa5beb95.tar.gz
loader: unregister input streams on EOF
if recvData returns 0, it must be treated the same as a broken pipe.
Diffstat (limited to 'src')
-rw-r--r--src/loader/loader.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/loader/loader.nim b/src/loader/loader.nim
index e4d7b1ca..70f84043 100644
--- a/src/loader/loader.nim
+++ b/src/loader/loader.nim
@@ -257,8 +257,8 @@ proc handleRead(ctx: LoaderContext; handle: LoaderHandle;
     let buffer = newLoaderBuffer()
     try:
       let n = handle.istream.recvData(buffer)
-      if n == 0:
-        break
+      if n == 0: # EOF
+        return hrrUnregister
       var si = 0
       if handle.parser != nil:
         si = handle.parseHeaders(buffer)