comparison mod_http_logging/mod_http_logging.lua @ 2163:88fec2b2bd58

mod_http_logging: Fix endless loop on 0.9.x (Thanks Mint)
author Kim Alvefur <zash@zash.se>
date Sat, 16 Apr 2016 20:21:13 +0200
parents c625ed20ebda
children 557c976735e1
comparison
equal deleted inserted replaced
2162:f1ea8044f9f8 2163:88fec2b2bd58
23 local ip = request.conn:ip(); 23 local ip = request.conn:ip();
24 local req = string.format("%s %s HTTP/%s", request.method, request.path, request.httpversion); 24 local req = string.format("%s %s HTTP/%s", request.method, request.path, request.httpversion);
25 local date = os.date("%d/%m/%Y:%H:%M:%S %z"); 25 local date = os.date("%d/%m/%Y:%H:%M:%S %z");
26 module:log("info", "%s - - [%s] \"%s\" %d %s", ip, date, req, response.status_code, tostring(len)); 26 module:log("info", "%s - - [%s] \"%s\" %d %s", ip, date, req, response.status_code, tostring(len));
27 end 27 end
28 return server.send_response(response, body); 28 return send_response(response, body);
29 end 29 end
30 30
31 if module.wrap_object_event then 31 if module.wrap_object_event then
32 -- Use object event wrapping, allows clean unloading of the module 32 -- Use object event wrapping, allows clean unloading of the module
33 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data) 33 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data)