luci-0.9: flush stdout during sysupgrade
[project/luci.git] / modules / admin-mini / luasrc / controller / mini / system.lua
index 075f51e91419c953b52a4e69ed881fe49a54c901..481fbf0f0e06b34237aedcd4c4cf0892e5d69c78 100644 (file)
@@ -151,6 +151,7 @@ function action_upgrade()
                if has_platform and has_image and has_support then
                        -- Mimetype text/plain
                        luci.http.prepare_content("text/plain")
+                       luci.http.write("Starting luci-flash...\n")
 
                        -- Now invoke sysupgrade
                        local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
@@ -163,6 +164,7 @@ function action_upgrade()
                                        local ln = fd:read("*l")
                                        if not ln then break end
                                        luci.http.write(ln .. "\n")
+                                       io.flush()
                                end
                                fd:close()
                        end