summaryrefslogtreecommitdiffhomepage
path: root/libs/httpd/luasrc/httpd.lua
diff options
context:
space:
mode:
Diffstat (limited to 'libs/httpd/luasrc/httpd.lua')
-rw-r--r--libs/httpd/luasrc/httpd.lua15
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/httpd/luasrc/httpd.lua b/libs/httpd/luasrc/httpd.lua
index f471e6b0cc..9f2dbcde12 100644
--- a/libs/httpd/luasrc/httpd.lua
+++ b/libs/httpd/luasrc/httpd.lua
@@ -48,13 +48,16 @@ function Thread.receive(self, ...)
local chunk, err, part
self.waiting = true
- repeat
- coroutine.yield()
+ while true do
chunk, err, part = self.socket:receive(...)
- until err ~= "timeout"
-
- self.waiting = false
- return chunk, err, part
+
+ if err ~= "timeout" then
+ self.waiting = false
+ return chunk, err, part
+ end
+
+ coroutine.yield()
+ end
end
function Thread.resume(self, ...)