From 5d62624e084f9de15e2c6408a8c007a7b4fabf60 Mon Sep 17 00:00:00 2001 From: Vladimir Dronnikov Date: Mon, 19 Jan 2015 23:32:16 +0300 Subject: [PATCH] cleanup http module --- lua_modules/http/http-example.lua | 6 ++---- lua_modules/http/http.lua | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lua_modules/http/http-example.lua b/lua_modules/http/http-example.lua index bd7df187..5d3788e8 100644 --- a/lua_modules/http/http-example.lua +++ b/lua_modules/http/http-example.lua @@ -6,9 +6,8 @@ ------------------------------------------------------------------------------ require("http").createServer(80, function(req, res) -- analyse method and url - print("+R", req.method, req.url) + print("+R", req.method, req.url, node.heap()) -- setup handler of headers, if any ---[[ req.onheader = function(self, name, value) -- print("+H", name, value) -- E.g. look for "content-type" header, @@ -34,8 +33,7 @@ require("http").createServer(80, function(req, res) res:finish() end end -]] -- or just do something not waiting till body (if any) comes --res:finish("Hello, world!") - res:finish("Salut, monde!") + --res:finish("Salut, monde!") end) diff --git a/lua_modules/http/http.lua b/lua_modules/http/http.lua index 9c52ce45..9f1e3f25 100644 --- a/lua_modules/http/http.lua +++ b/lua_modules/http/http.lua @@ -87,9 +87,7 @@ do return res end - tmr.wdclr() - - ------------------------------------------------------------------------------ + ------------------------------------------------------------------------------ -- HTTP parser ------------------------------------------------------------------------------ local http_handler = function(handler) @@ -190,8 +188,6 @@ do end end - tmr.wdclr() - ------------------------------------------------------------------------------ -- HTTP server ------------------------------------------------------------------------------