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