Add yield so that looong listings don't overflow mcu's buffer

This commit is contained in:
Marcos Kirsch 2015-02-28 16:39:40 -06:00
parent 77920f4a94
commit 5b472f3554

View File

@ -12,6 +12,8 @@ return function (connection, args)
local url = string.match(name, ".*/(.*)")
if isHttpFile then
connection:send(' <li><a href="' .. url .. '">' .. url .. "</a> (" .. size .. " bytes)</li>\n")
-- this list could be very long, so we'll yield in order to avoid overflowing the send buffer.
coroutine.yield()
end
end