mod_http_upload: Make case indentation consistent
Use four spaces (or the corresponding amount of tab characters) for case indentation everywhere in mod_http_upload and mod_http_upload_quota.
This commit is contained in:
		
							parent
							
								
									0a24936e92
								
							
						
					
					
						commit
						ea4964dccd
					
				| @ -123,7 +123,8 @@ start(ServerHost, Opts) -> | ||||
| 			       remove_user, 50), | ||||
| 	    ejabberd_hooks:add(anonymous_purge_hook, ServerHost, ?MODULE, | ||||
| 			       remove_user, 50); | ||||
|       false -> ok | ||||
| 	false -> | ||||
| 	    ok | ||||
|     end, | ||||
|     Proc = get_proc_name(ServerHost, ?PROCNAME), | ||||
|     Spec = {Proc, | ||||
| @ -145,7 +146,8 @@ stop(ServerHost) -> | ||||
| 				  remove_user, 50), | ||||
| 	    ejabberd_hooks:delete(anonymous_purge_hook, ServerHost, ?MODULE, | ||||
| 				  remove_user, 50); | ||||
|       false -> ok | ||||
| 	false -> | ||||
| 	    ok | ||||
|     end, | ||||
|     Proc = get_proc_name(ServerHost, ?PROCNAME), | ||||
|     supervisor:terminate_child(ejabberd_sup, Proc), | ||||
| @ -510,10 +512,12 @@ process_iq(From, | ||||
| 	allow -> | ||||
| 	    case parse_request(SubEl, Lang) of | ||||
| 		{ok, File, Size, ContentType} -> | ||||
| 		case create_slot(State, From, File, Size, ContentType, Lang) of | ||||
| 		    case create_slot(State, From, File, Size, ContentType, | ||||
| 				     Lang) of | ||||
| 			{ok, Slot} -> | ||||
| 			    {ok, Timer} = timer:send_after(?SLOT_TIMEOUT, | ||||
| 						     {slot_timed_out, Slot}), | ||||
| 							   {slot_timed_out, | ||||
| 							    Slot}), | ||||
| 			    NewState = add_slot(Slot, Size, Timer, State), | ||||
| 			    SlotEl = slot_el(Slot, State, XMLNS), | ||||
| 			    {IQ#iq{type = result, sub_el = [SlotEl]}, NewState}; | ||||
| @ -613,7 +617,8 @@ create_slot(#state{service_url = ServiceURL}, | ||||
|     case httpc:request(get, {GetRequest, []}, HttpOptions, Options) of | ||||
| 	{ok, {Code, Body}} when Code >= 200, Code =< 299 -> | ||||
| 	    case binary:split(Body, <<$\n>>, [global, trim]) of | ||||
| 	    [<<"http", _/binary>> = PutURL, <<"http", _/binary>> = GetURL] -> | ||||
| 		[<<"http", _/binary>> = PutURL, | ||||
| 		 <<"http", _/binary>> = GetURL] -> | ||||
| 		    ?INFO_MSG("Got HTTP upload slot for ~s (file: ~s)", | ||||
| 			      [jlib:jid_to_string(JID), File]), | ||||
| 		    {ok, PutURL, GetURL}; | ||||
|  | ||||
| @ -199,11 +199,13 @@ handle_info(sweep, #state{server_host = ServerHost, | ||||
| 	{ok, Entries} -> | ||||
| 	    BackThen = secs_since_epoch() - (MaxDays * 86400), | ||||
| 	    DocRootS = binary_to_list(DocRoot), | ||||
| 	  PathNames = lists:map(fun(Entry) -> DocRootS ++ "/" ++ Entry end, | ||||
| 				Entries), | ||||
| 	    PathNames = lists:map(fun(Entry) -> | ||||
| 					  DocRootS ++ "/" ++ Entry | ||||
| 				  end, Entries), | ||||
| 	    UserDirs = lists:filter(fun filelib:is_dir/1, PathNames), | ||||
| 	  lists:foreach(fun(UserDir) -> delete_old_files(UserDir, BackThen) end, | ||||
| 			UserDirs); | ||||
| 	    lists:foreach(fun(UserDir) -> | ||||
| 				  delete_old_files(UserDir, BackThen) | ||||
| 			  end, UserDirs); | ||||
| 	{error, Error} -> | ||||
| 	    ?ERROR_MSG("Cannot open document root ~s: ~s", | ||||
| 		       [DocRoot, ?FORMAT(Error)]) | ||||
| @ -276,9 +278,9 @@ enforce_quota(UserDir, SlotSize, _OldSize, MinSize, MaxSize) -> | ||||
| 
 | ||||
| -spec delete_old_files(file:filename_all(), integer()) -> ok. | ||||
| 
 | ||||
| delete_old_files(UserDir, Timestamp) -> | ||||
| delete_old_files(UserDir, CutOff) -> | ||||
|     FileInfo = gather_file_info(UserDir), | ||||
|     case [Path || {Path, _Size, Time} <- FileInfo, Time < Timestamp] of | ||||
|     case [Path || {Path, _Size, Time} <- FileInfo, Time < CutOff] of | ||||
| 	[] -> | ||||
| 	    ok; | ||||
| 	OldFiles -> | ||||
| @ -296,7 +298,8 @@ gather_file_info(Dir) -> | ||||
| 	{ok, Entries} -> | ||||
| 	    lists:foldl(fun(Entry, Acc) -> | ||||
| 				Path = Dir ++ "/" ++ Entry, | ||||
| 			      case file:read_file_info(Path, [{time, posix}]) of | ||||
| 				case file:read_file_info(Path, | ||||
| 							 [{time, posix}]) of | ||||
| 				    {ok, #file_info{type = directory}} -> | ||||
| 					gather_file_info(Path) ++ Acc; | ||||
| 				    {ok, #file_info{type = regular, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user