[fluksod] send POST response codes to syslog
This commit is contained in:
parent
5bffb794d7
commit
5defc5b906
|
@ -219,10 +219,12 @@ function send(child)
|
|||
hash:update(options.body)
|
||||
options.headers['X-Digest'] = hash:final()
|
||||
|
||||
local response, code, msg = http_persist(WAN_BASE_URL .. sensor_id, options)
|
||||
local url = WAN_BASE_URL .. sensor_id
|
||||
local response, code, meta = http_persist(url, options)
|
||||
|
||||
nixio.syslog('info', string.format('%s %s: %s', options.method, url, code))
|
||||
|
||||
if response then
|
||||
-- TODO send response string to syslog
|
||||
measurements:clear(sensor_id)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -131,9 +131,9 @@ function create_persistent()
|
|||
bytes_read = bytes_read + output[#output]:len()
|
||||
end
|
||||
|
||||
uri, options = coroutine.yield(table.concat(output))
|
||||
uri, options = coroutine.yield(table.concat(output), status, response)
|
||||
else
|
||||
uri, options = coroutine.yield("")
|
||||
uri, options = coroutine.yield("", status, response)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue