From 506822ee7080e86584a4f6436aeeb8edb411c88e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 7 Dec 2008 11:47:59 +0000 Subject: Make LuCIttpd work OOTB --- libs/lucittpd/luasrc/ttpd/server.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/lucittpd/luasrc/ttpd/server.lua') diff --git a/libs/lucittpd/luasrc/ttpd/server.lua b/libs/lucittpd/luasrc/ttpd/server.lua index 4cb246af8f..a2c7ffcb29 100644 --- a/libs/lucittpd/luasrc/ttpd/server.lua +++ b/libs/lucittpd/luasrc/ttpd/server.lua @@ -18,6 +18,7 @@ local pcall, assert = pcall, assert local os = require "os" local io = require "io" +local uci = require "luci.model.uci" local util = require "luci.util" local ltn12 = require "luci.ltn12" local proto = require "luci.http.protocol" @@ -91,6 +92,7 @@ end Server = util.class() function Server.__init__(self, host) + self.uci = uci.cursor() self.host = host self.vhosts = {} @@ -329,7 +331,7 @@ function Server.process(self, functions) close = not message.env.HTTP_CONNECTION or message.env.HTTP_CONNECTION == "close" end -- Uncomment this to disable keep-alive - -- close = true + close = not (self.uci:get("lucittpd", "lucittpd", "keepalive") == "1") if message.request_method == "get" or message.request_method == "head" then -- Be happy -- cgit v1.2.3