about summary refs log tree commit diff stats
path: root/src/local/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-24 17:02:58 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-24 17:02:58 +0100
commitdd2c0e4f501fcf860fe6b5eb67d14e07bbe43532 (patch)
tree82654be57aa104fccedf0178b50b4012e55bd324 /src/local/client.nim
parent5d452786d9e012c77b2ab002da9d15bab2273f42 (diff)
downloadchawan-dd2c0e4f501fcf860fe6b5eb67d14e07bbe43532.tar.gz
buffer: fix clone
Diffstat (limited to 'src/local/client.nim')
-rw-r--r--src/local/client.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/local/client.nim b/src/local/client.nim
index 9fd6c23a..ed149421 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -424,15 +424,15 @@ proc acceptBuffers(client: Client) =
           outCacheId = loader.addCacheFile(item.ostreamOutputId, pid).outputId
           loader.resume(@[item.istreamOutputId, item.ostreamOutputId])
         w.swrite(outCacheId)
-      else:
-        # buffer is cloned, no need to cache anything
-        container.setCloneStream(stream, registerFun)
     if item.fdin != -1:
       # pass down fdout
       # must come after the previous block so the first packet is flushed
       stream.sendFileHandle(item.fdout)
       discard close(item.fdout)
       container.setStream(stream, registerFun)
+    else:
+      # buffer is cloned, no need to cache anything
+      container.setCloneStream(stream, registerFun)
     let fd = int(stream.fd)
     client.fdmap[fd] = container
     client.selector.registerHandle(fd, {Read}, 0)