diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/loader/loaderhandle.nim | 7 |
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 = |