use callback in 'getLimit'

This commit is contained in:
ansuz 2017-05-12 15:39:55 +02:00
parent 77efc2cee7
commit fa4b17e2bc

6
rpc.js
View file

@ -509,9 +509,12 @@ var updateLimits = function (config, publicKey, cb) {
req.end(body);
};
var getLimit = function (publicKey, cb) {
var limit = limits[publicKey];
return limit && typeof limit.limit === "number" ? limit.limit : DEFAULT_LIMIT;
cb(void 0, limit && typeof(limit.limit) === "number"?
limit.limit : DEFAULT_LIMIT);
};
var safeMkdir = function (path, cb) {
@ -787,7 +790,6 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
Respond(void 0, dict);
});
// restricted to privileged users...
case 'UPLOAD':
if (!privileged) { return deny(); }