diff --git a/webserver.lua b/webserver.lua index 15c80e0..a24141f 100644 --- a/webserver.lua +++ b/webserver.lua @@ -4,12 +4,13 @@ configFile="config.lua" sentBytes=0 function sendPage(conn, nameOfFile, replaceMap) - + print("Sending " .. nameOfFile .. " " .. sentBytes .. "B already") conn:on("sent", function(conn) if (sentBytes == 0) then conn:close() print("Page sent") - else + else + print("Next") sendPage(conn, nameOfFile, replaceMap) end end) @@ -48,6 +49,7 @@ function sendPage(conn, nameOfFile, replaceMap) if (string.len(buf) >= 700) then line=nil conn:send(buf) + print("Sent part of " .. sentBytes .. "B") -- end the function, this part is sent return else @@ -59,6 +61,7 @@ function sendPage(conn, nameOfFile, replaceMap) sentBytes=0 -- send the rest conn:send(buf) + print("Sent rest") end end @@ -209,14 +212,19 @@ function startWebServer() print("Rename config") if (file.rename(configFile .. ".new", configFile)) then print("Successfully") - dofile(configFile) -- load the new values - replaceMap=fillDynamicMap() - replaceMap["$ADDITIONAL_LINE"]="