Browse Source

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

Marcos Kirsch 9 years ago
parent
commit
5b472f3554
1 changed files with 2 additions and 0 deletions
  1. 2 0
      http/file_list.lua

+ 2 - 0
http/file_list.lua

@@ -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