diff options
author | Lukáš Ježek <lukas.jezek@nic.cz> | 2021-07-02 15:15:01 +0200 |
---|---|---|
committer | Tomas Krizek <tomas.krizek@nic.cz> | 2021-07-29 11:42:32 +0200 |
commit | 8aec5d87e8d4e185a3f472a0bdda1f5a7af8e470 (patch) | |
tree | 68e1ad8446649df5e90c0fedc1793a4b44e11c91 /modules/http | |
parent | log: use kr_log_debug instead kr_log_verbose (diff) | |
download | knot-resolver-8aec5d87e8d4e185a3f472a0bdda1f5a7af8e470.tar.xz knot-resolver-8aec5d87e8d4e185a3f472a0bdda1f5a7af8e470.zip |
log: fix kr_log_fmt SIGSEGV crash
Diffstat (limited to 'modules/http')
-rw-r--r-- | modules/http/http.lua.in | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/http/http.lua.in b/modules/http/http.lua.in index 1f374ffc..56baab17 100644 --- a/modules/http/http.lua.in +++ b/modules/http/http.lua.in @@ -224,8 +224,8 @@ local function route(endpoints) -- Upgrade connection to WebSocket local ws = http_websocket.new_from_stream(stream, h) if ws then - log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTP/%d web socket open', - m, path, connection.version) + log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTP/%s web socket open', + m, path, tostring(connection.version)) assert(ws:accept { protocols = {'json'} }) -- Continue streaming results to client local ep = endpoints[path] @@ -234,15 +234,15 @@ local function route(endpoints) cb(h, ws) end ws:close() - log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTP/%d web socket closed', - m, path, connection.version) + log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTP/%s web socket closed', + m, path, tostring(connection.version)) return else local ok, err, reason = http_util.yieldable_pcall(serve, endpoints, h, stream) if not ok or err then err = err or '500' - log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTTP/%d %s %s', - m, path, connection.version, err, reason or '') + log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTTP/%s %s %s', + m, path, tostring(connection.version), err, reason or '') -- Method is not supported local hsend = http_headers.new() hsend:append(':status', err) @@ -253,8 +253,8 @@ local function route(endpoints) assert(stream:write_headers(hsend, true)) end else - log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTP/%d 200', - m, path, connection.version) + log_info(ffi.C.LOG_GRP_DOH, '%s %s HTTP/%s 200', + m, path, tostring(connection.version)) end end |