Software /
code /
prosody
Comparison
util/helpers.lua @ 8411:a9e8523a5e73
util.helpers: Handle missing priorities, happens due to wildcard magic in net.http.server (fixes #1044)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 22 Nov 2017 02:34:42 +0100 |
parent | 7720:7166750fb963 |
child | 11059:ad89e3cc67b6 |
comparison
equal
deleted
inserted
replaced
8409:e98b4352d7df | 8411:a9e8523a5e73 |
---|---|
48 if handlers and (event == specific_event or not specific_event) then | 48 if handlers and (event == specific_event or not specific_event) then |
49 table.insert(events_array, event); | 49 table.insert(events_array, event); |
50 local handler_strings = {}; | 50 local handler_strings = {}; |
51 for i, handler in ipairs(handlers) do | 51 for i, handler in ipairs(handlers) do |
52 local upvals = debug.string_from_var_table(debug.get_upvalues_table(handler)); | 52 local upvals = debug.string_from_var_table(debug.get_upvalues_table(handler)); |
53 handler_strings[i] = " "..priorities[handler]..": "..tostring(handler)..(upvals and ("\n "..upvals) or ""); | 53 handler_strings[i] = " "..(priorities[handler] or "?")..": "..tostring(handler)..(upvals and ("\n "..upvals) or ""); |
54 end | 54 end |
55 event_handler_arrays[event] = handler_strings; | 55 event_handler_arrays[event] = handler_strings; |
56 end | 56 end |
57 end | 57 end |
58 table.sort(events_array); | 58 table.sort(events_array); |