diff --git a/http/file_list.lua b/http/file_list.lua index 81d657a..2935ec8 100644 --- a/http/file_list.lua +++ b/http/file_list.lua @@ -1,4 +1,4 @@ -return function (connection, args) +return function (connection, req, args) dofile("httpserver-header.lc")(connection, 200, 'html') connection:send([===[ @@ -6,21 +6,18 @@ return function (connection, args)

Server File Listing

]===]) - coroutine.yield() local remaining, used, total=file.fsinfo() connection:send("Total size: " .. total .. " bytes
\n" .. "In Use: " .. used .. " bytes
\n" .. "Free: " .. remaining .. " bytes
\n" .. "

\nFiles:
\n

\n

\n") diff --git a/http/garage_door_opener.lua b/http/garage_door_opener.lua index 5827a1d..ca67617 100644 --- a/http/garage_door_opener.lua +++ b/http/garage_door_opener.lua @@ -17,7 +17,6 @@ local function pushTheButton(connection, pin) -- Send back JSON response. connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n") - coroutine.yield() connection:send('{"error":0, "message":"OK"}') end @@ -28,7 +27,6 @@ return function (connection, req, args) elseif args.door == "2" then pushTheButton(connection, 2) -- GPIO2 else connection:send("HTTP/1.0 400 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n") - coroutine.yield() connection:send('{"error":-1, "message":"Bad door"}') end end diff --git a/http/node_info.lua b/http/node_info.lua index dac2c3f..025b3aa 100644 --- a/http/node_info.lua +++ b/http/node_info.lua @@ -1,12 +1,10 @@ local function sendAttr(connection, attr, val) connection:send("
  • ".. attr .. ": " .. val .. "
  • \n") - coroutine.yield() end -return function (connection, args) +return function (connection, req, args) dofile("httpserver-header.lc")(connection, 200, 'html') connection:send('A Lua script sample

    Node info