aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/tp.lua')
-rw-r--r--src/tp.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/tp.lua b/src/tp.lua
index e9e38a1..4f2a615 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -87,13 +87,9 @@ function metat.__index:getcontrol()
87 return self.control 87 return self.control
88end 88end
89 89
90function metat.__index:source(src, instr) 90function metat.__index:source(source, step)
91 while true do 91 local sink = socket.sink("keep-open", self.control)
92 local chunk, err = src() 92 return ltn12.pump.all(source, sink, step or ltn12.pump.step)
93 if not chunk then return not err, err end
94 local ret, err = self.control:send(chunk)
95 if not ret then return nil, err end
96 end
97end 93end
98 94
99-- closes the underlying control 95-- closes the underlying control