diff options
Diffstat (limited to 'server.lua')
-rw-r--r-- | server.lua | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -3,10 +3,10 @@ Copyright (c) 2012-2014 Kaarle Ritvanen See LICENSE file for license details --]] -local acf = require('acf2') -local mbin = acf.model.binary -local mnode = acf.model.node -local isinstance = acf.object.isinstance +local aconf = require('aconf') +local mbin = aconf.model.binary +local mnode = aconf.model.node +local isinstance = aconf.object.isinstance local json = require('cjson') local posix = require('posix') @@ -45,7 +45,7 @@ return function(env) function() coroutine.yield(res) posix.close(uwsgi.connection_fd()) - acf.commit() + aconf.commit() end ) end @@ -73,13 +73,13 @@ return function(env) local session, user, txn_id function reset_session_expiry() session.expires = os.time() + 600 end - local sid = tonumber(env.HTTP_X_ACF_AUTH_TOKEN) + local sid = tonumber(env.HTTP_X_ACONF_AUTH_TOKEN) if sid then session = sessions[sid] if not session then return wrap(401) end reset_session_expiry() user = session.user - txn_id = tonumber(env.HTTP_X_ACF_TRANSACTION_ID) + txn_id = tonumber(env.HTTP_X_ACONF_TRANSACTION_ID) end local parent_txn @@ -91,7 +91,7 @@ return function(env) end local function new_txn(defer_validation) - return acf.start_txn{ + return aconf.start_txn{ allow_commit_defer=true, defer_validation=defer_validation, parent=parent_txn @@ -126,8 +126,8 @@ return function(env) return wrap( 204, { - ['X-ACF-Auth-Token']=sid, - ['X-ACF-Save-Required']=save_req and 1 or 0 + ['X-AConf-Auth-Token']=sid, + ['X-AConf-Save-Required']=save_req and 1 or 0 } ) end @@ -153,7 +153,7 @@ return function(env) return wrap(500, nil, 'lbu commit failed') end - local success, code, hdr, res = acf.call( + local success, code, hdr, res = aconf.call( function() if stringy.startswith(path, '/meta/') then if method ~= 'GET' then return 405 end @@ -165,8 +165,8 @@ return function(env) local parent, name, res if path ~= '/' then - parent = txn:fetch(acf.path.parent(path)) - name = acf.path.name(path) + parent = txn:fetch(aconf.path.parent(path)) + name = aconf.path.name(path) end if method == 'GET' then @@ -275,7 +275,7 @@ return function(env) session.last_txn_id = session.last_txn_id + 1 local txn_id = session.last_txn_id session.txns[txn_id] = new_txn() - return 204, {['X-ACF-Transaction-ID']=txn_id} + return 204, {['X-AConf-Transaction-ID']=txn_id} end return 404 |