Diff

net/http.lua @ 11220:9b25eecde9e6

net.http: track time of request for debug/stats purposes
author Matthew Wild <mwild1@gmail.com>
date Wed, 09 Dec 2020 13:54:21 +0000
parent 11185:409ce7686c11
child 11661:735b8f4a6d7e
line wrap: on
line diff
--- a/net/http.lua	Tue Dec 08 20:35:53 2020 +0100
+++ b/net/http.lua	Wed Dec 09 13:54:21 2020 +0000
@@ -24,6 +24,7 @@
 local pairs = pairs;
 local tonumber, tostring, traceback =
       tonumber, tostring, debug.traceback;
+local os_time = os.time;
 local xpcall = require "util.xpcall".xpcall;
 local error = error
 
@@ -221,6 +222,7 @@
 
 	req.url = u;
 	req.http = self;
+	req.time = os_time();
 
 	if not req.path then
 		req.path = "/";