Software /
code /
prosody
Comparison
net/http/server.lua @ 7582:e080b8b4f3cb
net.http.server: Add luacheck annotations
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Aug 2016 15:21:30 +0200 |
parent | 7581:01d0d466d7be |
child | 8362:c7d6c2558a24 |
comparison
equal
deleted
inserted
replaced
7581:01d0d466d7be | 7582:e080b8b4f3cb |
---|---|
30 local function is_wildcard_match(wildcard_event, event) | 30 local function is_wildcard_match(wildcard_event, event) |
31 return wildcard_event:sub(1, -2) == event:sub(1, #wildcard_event-1); | 31 return wildcard_event:sub(1, -2) == event:sub(1, #wildcard_event-1); |
32 end | 32 end |
33 | 33 |
34 local _handlers = events._handlers; | 34 local _handlers = events._handlers; |
35 local recent_wildcard_events = cache.new(10000, function (key, value) | 35 local recent_wildcard_events = cache.new(10000, function (key, value) -- luacheck: ignore 212/value |
36 rawset(_handlers, key, nil); | 36 rawset(_handlers, key, nil); |
37 end); | 37 end); |
38 | 38 |
39 local event_map = events._event_map; | 39 local event_map = events._event_map; |
40 setmetatable(events._handlers, { | 40 setmetatable(events._handlers, { |
172 t[k] = v; | 172 t[k] = v; |
173 return v; | 173 return v; |
174 end | 174 end |
175 }); | 175 }); |
176 | 176 |
177 function _M.hijack_response(response, listener) | 177 function _M.hijack_response(response, listener) -- luacheck: ignore |
178 error("TODO"); | 178 error("TODO"); |
179 end | 179 end |
180 function handle_request(conn, request, finish_cb) | 180 function handle_request(conn, request, finish_cb) |
181 --log("debug", "handler: %s", request.path); | 181 --log("debug", "handler: %s", request.path); |
182 local headers = {}; | 182 local headers = {}; |