about summary refs log tree commit diff stats
path: root/src/loader
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-12 22:11:51 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-12 22:11:51 +0100
commitc2bc54b88fdd0297255d21192f4936e3a9de0075 (patch)
treedcf9f62d37de20773215547e1f7cc8daee81db85 /src/loader
parente0bc31cd1191516380392fb43fe1db5d88067a5c (diff)
downloadchawan-c2bc54b88fdd0297255d21192f4936e3a9de0075.tar.gz
stricter typing
Diffstat (limited to 'src/loader')
-rw-r--r--src/loader/loaderhandle.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/loader/loaderhandle.nim b/src/loader/loaderhandle.nim
index 54054ed1..fe8c6435 100644
--- a/src/loader/loaderhandle.nim
+++ b/src/loader/loaderhandle.nim
@@ -28,7 +28,7 @@ type
     buffers: Deque[LoaderBuffer]
     ostream*: PosixStream
     istreamAtEnd*: bool
-    sostream*: PosixStream # saved ostream when redirected
+    sostream*: SocketStream # saved ostream when redirected
     clientId*: StreamId
     registered*: bool
 
@@ -134,8 +134,9 @@ proc sendHeaders*(handle: LoaderHandle, headers: Headers) =
     output.ostream.sread(redir)
     output.ostream.sread(handle.cached)
     if redir:
-      let fd = SocketStream(output.ostream).recvFileHandle()
-      output.sostream = output.ostream
+      let sostream = SocketStream(output.ostream)
+      let fd = sostream.recvFileHandle()
+      output.sostream = sostream
       output.ostream = newPosixStream(fd)
 
 proc sendData*(output: OutputHandle, p: pointer, nmemb: int): int =