mod_log_slow_events: Turn into a shared module (fixes http events being logged multiple times)

Tue, 21 Nov 2017 23:00:21 +0100

author
Kim Alvefur <zash@zash.se>
date
Tue, 21 Nov 2017 23:00:21 +0100
changeset 2849
5e74028557dc
parent 2848
232da6b1d2c1
child 2850
3ba8fd1a297e

mod_log_slow_events: Turn into a shared module (fixes http events being logged multiple times)

mod_log_slow_events/mod_log_slow_events.lua file | annotate | diff | comparison | revisions
--- a/mod_log_slow_events/mod_log_slow_events.lua	Tue Nov 21 16:58:50 2017 +0100
+++ b/mod_log_slow_events/mod_log_slow_events.lua	Tue Nov 21 23:00:21 2017 +0100
@@ -1,3 +1,5 @@
+module:set_global();
+
 local time = require "socket".gettime;
 local base64_decode = require "util.encodings".base64.decode;
 
@@ -52,7 +54,9 @@
 	return ret;
 end
 
-module:wrap_event(false, event_wrapper);
 local http_events = require "net.http.server"._events;
 module:wrap_object_event(http_events, false, event_wrapper);
 
+function module.add_host(module)
+	module:wrap_event(false, event_wrapper);
+end

mercurial