[fluksod] send POST response codes to syslog

This commit is contained in:
Bart Van Der Meerssche 2011-04-05 10:31:34 +02:00
parent 5bffb794d7
commit 5defc5b906
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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