summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/lua/mtx-server.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/context/lua/mtx-server.lua')
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-server.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-server.lua b/Master/texmf-dist/scripts/context/lua/mtx-server.lua
index 615506ac0ce..dc0befcaa2f 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-server.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-server.lua
@@ -252,7 +252,8 @@ function scripts.webserver.run(configuration)
end
-- locate root and index file in tex tree
if not lfs.isdir(configuration.root) then
- for _, name in ipairs(indices) do
+ for i=1,#indices do
+ local name = indices[i]
local root = resolvers.resolve("path:" .. name) or ""
if root ~= "" then
configuration.root = root
@@ -263,7 +264,8 @@ function scripts.webserver.run(configuration)
end
configuration.root = dir.expand_name(configuration.root)
if not configuration.index then
- for _, name in ipairs(indices) do
+ for i=1,#indices do
+ local name = indices[i]
if lfs.isfile(file.join(configuration.root,name)) then
configuration.index = name -- we will prepend the rootpath later
break
@@ -281,8 +283,11 @@ function scripts.webserver.run(configuration)
logs.simple("scripts subpath: %s",configuration.scripts)
logs.simple("context services: http://localhost:%s/mtx-server-ctx-startup.lua",configuration.port)
local server = assert(socket.bind("*", configuration.port))
+--~ local reading = { server }
while true do -- no multiple clients
local start = os.clock()
+--~ local input = socket.select(reading)
+--~ local client = input:accept()
local client = server:accept()
client:settimeout(configuration.timeout or 60)
local request, e = client:receive()
@@ -323,7 +328,7 @@ function scripts.webserver.run(configuration)
end
end
-logs.extendbanner("Simple Webserver 0.10")
+logs.extendbanner("Simple Webserver For Helpers 0.10")
messages.help = [[
--start start server