about summary refs log tree commit diff stats
path: root/src/io/dynstream.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/dynstream.nim')
-rw-r--r--src/io/dynstream.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/io/dynstream.nim b/src/io/dynstream.nim
index ac1269f5..10db4c64 100644
--- a/src/io/dynstream.nim
+++ b/src/io/dynstream.nim
@@ -46,6 +46,13 @@ proc sendDataLoop*(s: DynStream; buffer: pointer; len: int) =
     if n == len:
       break
 
+proc recvDataLoop*(s: DynStream; buffer: pointer; len: int) =
+  var n = 0
+  while true:
+    n += s.recvData(addr cast[ptr UncheckedArray[uint8]](buffer)[n], len - n)
+    if n == len:
+      break
+
 proc dsClose(s: Stream) =
   DynStream(s).sclose()