* libs/httpd: Fixed a problem with empty sources in filehandler
authorSteven Barth <steven@midlink.org>
Sat, 28 Jun 2008 17:03:47 +0000 (17:03 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 28 Jun 2008 17:03:47 +0000 (17:03 +0000)
libs/httpd/luasrc/httpd/handler/file.lua
libs/web/luasrc/dispatcher.lua

index 790ebdd6691d63b936d60f65e61754ef94014099..2ca3786ee872b0cbe6b5c8ec726d5144534fe07d 100644 (file)
@@ -72,20 +72,16 @@ function Simple.handle_get(self, request, sourcein, sinkerr)
                                                                }
                                                        ), ltn12.source.file(io.open(file))
                                                else
-                                                       return Response( code, hdrs or { } ),
-                                                               ltn12.source.empty()
+                                                       return Response( code, hdrs or { } )
                                                end
                                        else
-                                               return Response( code, hdrs or { } ),
-                                                       ltn12.source.empty()
+                                               return Response( code, hdrs or { } )
                                        end
                                else
-                                       return Response( code, hdrs or { } ),
-                                               ltn12.source.empty()
+                                       return Response( code, hdrs or { } )
                                end
                        else
-                               return Response( code, hdrs or { } ),
-                                       ltn12.source.empty()
+                               return Response( code, hdrs or { } )
                        end
                else
                        return self:failure(403, "Unable to transmit " .. stat.type .. " " .. file)
index 989eb44021d4e78b9f40a463638e7ad57fd87932..426dd66bd075a58df2f1c1b646f89d5fb486e5f3 100644 (file)
@@ -283,6 +283,7 @@ function createtree()
                local stat, err = luci.util.copcall(v)
                if not stat then
                        error500("createtree failed: " .. k .. ": " .. err)
+                       luci.http.close()
                        os.exit(1)
                end
        end