mod_http_upload/mod_http_upload.lua
changeset 3661 3fb0add97cdb
parent 3653 d252c8573f33
child 3662 02a1615d0392
equal deleted inserted replaced
3660:3e0f4d727825 3661:3fb0add97cdb
   102 
   102 
   103 -- state
   103 -- state
   104 local pending_slots = module:shared("upload_slots");
   104 local pending_slots = module:shared("upload_slots");
   105 
   105 
   106 local storage_path = module:get_option_string(module.name .. "_path", join_path(prosody.paths.data, module.name));
   106 local storage_path = module:get_option_string(module.name .. "_path", join_path(prosody.paths.data, module.name));
   107 lfs.mkdir(storage_path);
   107 
       
   108 do
       
   109 	local ok, err, errno = lfs.mkdir(storage_path);
       
   110 	-- 17 should be EEXIST, which is fine
       
   111 	assert(ok or errno == 17, "Storage path must be writable by Prosody\n"..err);
       
   112 end
   108 
   113 
   109 local function expire(username, host)
   114 local function expire(username, host)
   110 	if not max_age then return true; end
   115 	if not max_age then return true; end
   111 	local uploads, err = datamanager.list_load(username, host, module.name);
   116 	local uploads, err = datamanager.list_load(username, host, module.name);
   112 	if err then return false, err; end
   117 	if err then return false, err; end