Software / code / prosody
Comparison
net/http.lua @ 10112:b327f2870382
net.*: Remove tostring call from logging
Taken care of by loggingmanager now
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 30 Jul 2019 02:35:17 +0200 |
| parent | 9611:2700317f93e4 |
| child | 10235:6c804b6b2ca2 |
comparison
equal
deleted
inserted
replaced
| 10111:0f335815244f | 10112:b327f2870382 |
|---|---|
| 38 | 38 |
| 39 -- Request-related helper functions | 39 -- Request-related helper functions |
| 40 local function handleerr(err) log("error", "Traceback[http]: %s", traceback(tostring(err), 2)); return err; end | 40 local function handleerr(err) log("error", "Traceback[http]: %s", traceback(tostring(err), 2)); return err; end |
| 41 local function log_if_failed(req, ret, ...) | 41 local function log_if_failed(req, ret, ...) |
| 42 if not ret then | 42 if not ret then |
| 43 log("error", "Request '%s': error in callback: %s", req.id, tostring((...))); | 43 log("error", "Request '%s': error in callback: %s", req.id, (...)); |
| 44 if not req.suppress_errors then | 44 if not req.suppress_errors then |
| 45 error(...); | 45 error(...); |
| 46 end | 46 end |
| 47 end | 47 end |
| 48 return ...; | 48 return ...; |
| 148 | 148 |
| 149 function listener.onincoming(conn, data) | 149 function listener.onincoming(conn, data) |
| 150 local request = requests[conn]; | 150 local request = requests[conn]; |
| 151 | 151 |
| 152 if not request then | 152 if not request then |
| 153 log("warn", "Received response from connection %s with no request attached!", tostring(conn)); | 153 log("warn", "Received response from connection %s with no request attached!", conn); |
| 154 return; | 154 return; |
| 155 end | 155 end |
| 156 | 156 |
| 157 if data and request.reader then | 157 if data and request.reader then |
| 158 request:reader(data); | 158 request:reader(data); |