tabs -> spaces
This commit is contained in:
		
							parent
							
								
									203aeae69f
								
							
						
					
					
						commit
						10bec70734
					
				| 
						 | 
					@ -136,7 +136,7 @@ start(normal, []) ->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ok = rabbit_amqqueue:start(),
 | 
					                ok = rabbit_amqqueue:start(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		{ok, MemoryAlarms} = application:get_env(memory_alarms),
 | 
					                {ok, MemoryAlarms} = application:get_env(memory_alarms),
 | 
				
			||||||
                ok = rabbit_alarm:start(MemoryAlarms),
 | 
					                ok = rabbit_alarm:start(MemoryAlarms),
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                ok = rabbit_binary_generator:
 | 
					                ok = rabbit_binary_generator:
 | 
				
			||||||
| 
						 | 
					@ -304,7 +304,7 @@ rotate_logs(File, Suffix, OldHandler, NewHandler) ->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
log_rotation_result({error, MainLogError}, {error, SaslLogError}) ->
 | 
					log_rotation_result({error, MainLogError}, {error, SaslLogError}) ->
 | 
				
			||||||
    {error, {{cannot_rotate_main_logs, MainLogError},
 | 
					    {error, {{cannot_rotate_main_logs, MainLogError},
 | 
				
			||||||
	     {cannot_rotate_sasl_logs, SaslLogError}}};
 | 
					             {cannot_rotate_sasl_logs, SaslLogError}}};
 | 
				
			||||||
log_rotation_result({error, MainLogError}, ok) ->
 | 
					log_rotation_result({error, MainLogError}, ok) ->
 | 
				
			||||||
    {error, {cannot_rotate_main_logs, MainLogError}};
 | 
					    {error, {cannot_rotate_main_logs, MainLogError}};
 | 
				
			||||||
log_rotation_result(ok, {error, SaslLogError}) ->
 | 
					log_rotation_result(ok, {error, SaslLogError}) ->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -245,8 +245,8 @@ add_vhost(VHostPath) ->
 | 
				
			||||||
                                  [{<<"">>,           direct},
 | 
					                                  [{<<"">>,           direct},
 | 
				
			||||||
                                   {<<"amq.direct">>, direct},
 | 
					                                   {<<"amq.direct">>, direct},
 | 
				
			||||||
                                   {<<"amq.topic">>,  topic},
 | 
					                                   {<<"amq.topic">>,  topic},
 | 
				
			||||||
				   {<<"amq.match">>,  headers}, %% per 0-9-1 pdf
 | 
					                                   {<<"amq.match">>,  headers}, %% per 0-9-1 pdf
 | 
				
			||||||
				   {<<"amq.headers">>,  headers}, %% per 0-9-1 xml
 | 
					                                   {<<"amq.headers">>,  headers}, %% per 0-9-1 xml
 | 
				
			||||||
                                   {<<"amq.fanout">>, fanout}]],
 | 
					                                   {<<"amq.fanout">>, fanout}]],
 | 
				
			||||||
                          ok;
 | 
					                          ok;
 | 
				
			||||||
                      [_] ->
 | 
					                      [_] ->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -235,9 +235,9 @@ route(X = #exchange{type = topic}, RoutingKey, _Content) ->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
route(X = #exchange{type = headers}, _RoutingKey, Content) ->
 | 
					route(X = #exchange{type = headers}, _RoutingKey, Content) ->
 | 
				
			||||||
    Headers = case (Content#content.properties)#'P_basic'.headers of
 | 
					    Headers = case (Content#content.properties)#'P_basic'.headers of
 | 
				
			||||||
		  undefined -> [];
 | 
					                  undefined -> [];
 | 
				
			||||||
		  H         -> sort_arguments(H)
 | 
					                  H         -> sort_arguments(H)
 | 
				
			||||||
	      end,
 | 
					              end,
 | 
				
			||||||
    match_bindings(X, fun (#binding{args = Spec}) ->
 | 
					    match_bindings(X, fun (#binding{args = Spec}) ->
 | 
				
			||||||
                              headers_match(Spec, Headers)
 | 
					                              headers_match(Spec, Headers)
 | 
				
			||||||
                      end);
 | 
					                      end);
 | 
				
			||||||
| 
						 | 
					@ -489,14 +489,14 @@ parse_x_match(Other) ->
 | 
				
			||||||
%%
 | 
					%%
 | 
				
			||||||
headers_match(Pattern, Data) ->
 | 
					headers_match(Pattern, Data) ->
 | 
				
			||||||
    MatchKind = case lists:keysearch(<<"x-match">>, 1, Pattern) of
 | 
					    MatchKind = case lists:keysearch(<<"x-match">>, 1, Pattern) of
 | 
				
			||||||
		    {value, {_, longstr, MK}} -> parse_x_match(MK);
 | 
					                    {value, {_, longstr, MK}} -> parse_x_match(MK);
 | 
				
			||||||
		    {value, {_, Type, MK}} ->
 | 
					                    {value, {_, Type, MK}} ->
 | 
				
			||||||
			rabbit_log:warning("Invalid x-match field type ~p "
 | 
					                        rabbit_log:warning("Invalid x-match field type ~p "
 | 
				
			||||||
                                           "(value ~p); expected longstr",
 | 
					                                           "(value ~p); expected longstr",
 | 
				
			||||||
					   [Type, MK]),
 | 
					                                           [Type, MK]),
 | 
				
			||||||
			default_headers_match_kind();
 | 
					                        default_headers_match_kind();
 | 
				
			||||||
		    _ -> default_headers_match_kind()
 | 
					                    _ -> default_headers_match_kind()
 | 
				
			||||||
		end,
 | 
					                end,
 | 
				
			||||||
    headers_match(Pattern, Data, true, false, MatchKind).
 | 
					    headers_match(Pattern, Data, true, false, MatchKind).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
headers_match([], _Data, AllMatch, _AnyMatch, all) ->
 | 
					headers_match([], _Data, AllMatch, _AnyMatch, all) ->
 | 
				
			||||||
| 
						 | 
					@ -523,8 +523,8 @@ headers_match([{PK, PT, PV} | PRest], [{DK, DT, DV} | DRest],
 | 
				
			||||||
            %% the corresponding data field. I've interpreted that to
 | 
					            %% the corresponding data field. I've interpreted that to
 | 
				
			||||||
            %% mean a type of "void" for the pattern field.
 | 
					            %% mean a type of "void" for the pattern field.
 | 
				
			||||||
            PT == void -> {AllMatch, true};
 | 
					            PT == void -> {AllMatch, true};
 | 
				
			||||||
	    %% Similarly, it's not specified, but I assume that a
 | 
					            %% Similarly, it's not specified, but I assume that a
 | 
				
			||||||
	    %% mismatched type causes a mismatched value.
 | 
					            %% mismatched type causes a mismatched value.
 | 
				
			||||||
            PT =/= DT  -> {false, AnyMatch};
 | 
					            PT =/= DT  -> {false, AnyMatch};
 | 
				
			||||||
            PV == DV   -> {AllMatch, true};
 | 
					            PV == DV   -> {AllMatch, true};
 | 
				
			||||||
            true       -> {false, AnyMatch}
 | 
					            true       -> {false, AnyMatch}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,7 +75,7 @@ debug(Fmt, Args) when is_list(Args) ->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
message(Direction, Channel, MethodRecord, Content) ->
 | 
					message(Direction, Channel, MethodRecord, Content) ->
 | 
				
			||||||
    gen_server:cast(?SERVER,
 | 
					    gen_server:cast(?SERVER,
 | 
				
			||||||
		    {message, Direction, Channel, MethodRecord, Content}).
 | 
					                    {message, Direction, Channel, MethodRecord, Content}).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
info(Fmt) ->
 | 
					info(Fmt) ->
 | 
				
			||||||
    gen_server:cast(?SERVER, {info, Fmt}).
 | 
					    gen_server:cast(?SERVER, {info, Fmt}).
 | 
				
			||||||
| 
						 | 
					@ -112,11 +112,11 @@ handle_cast({debug, Fmt, Args}, State) ->
 | 
				
			||||||
    {noreply, State};
 | 
					    {noreply, State};
 | 
				
			||||||
handle_cast({message, Direction, Channel, MethodRecord, Content}, State) ->
 | 
					handle_cast({message, Direction, Channel, MethodRecord, Content}, State) ->
 | 
				
			||||||
    io:format("~s ch~p ~p~n",
 | 
					    io:format("~s ch~p ~p~n",
 | 
				
			||||||
	      [case Direction of
 | 
					              [case Direction of
 | 
				
			||||||
		   in -> "-->";
 | 
					                   in -> "-->";
 | 
				
			||||||
		   out -> "<--" end,
 | 
					                   out -> "<--" end,
 | 
				
			||||||
	       Channel,
 | 
					               Channel,
 | 
				
			||||||
	       {MethodRecord, Content}]),
 | 
					               {MethodRecord, Content}]),
 | 
				
			||||||
    {noreply, State};
 | 
					    {noreply, State};
 | 
				
			||||||
handle_cast({info, Fmt}, State) ->
 | 
					handle_cast({info, Fmt}, State) ->
 | 
				
			||||||
    error_logger:info_msg(Fmt),
 | 
					    error_logger:info_msg(Fmt),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -231,7 +231,7 @@ start_connection(Parent, Deb, ClientSock) ->
 | 
				
			||||||
                                    connection_state = pre_init},
 | 
					                                    connection_state = pre_init},
 | 
				
			||||||
                                handshake, 8))
 | 
					                                handshake, 8))
 | 
				
			||||||
    catch
 | 
					    catch
 | 
				
			||||||
	Ex -> (if Ex == connection_closed_abruptly ->
 | 
					        Ex -> (if Ex == connection_closed_abruptly ->
 | 
				
			||||||
                       fun rabbit_log:warning/2;
 | 
					                       fun rabbit_log:warning/2;
 | 
				
			||||||
                  true ->
 | 
					                  true ->
 | 
				
			||||||
                       fun rabbit_log:error/2
 | 
					                       fun rabbit_log:error/2
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -261,7 +261,7 @@ test_log_management() ->
 | 
				
			||||||
    %% original log files are not writable
 | 
					    %% original log files are not writable
 | 
				
			||||||
    ok = make_files_non_writable([MainLog, SaslLog]),
 | 
					    ok = make_files_non_writable([MainLog, SaslLog]),
 | 
				
			||||||
    {error, {{cannot_rotate_main_logs, _},
 | 
					    {error, {{cannot_rotate_main_logs, _},
 | 
				
			||||||
	     {cannot_rotate_sasl_logs, _}}} = control_action(rotate_logs, []),
 | 
					             {cannot_rotate_sasl_logs, _}}} = control_action(rotate_logs, []),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    %% logging directed to tty (handlers were removed in last test)
 | 
					    %% logging directed to tty (handlers were removed in last test)
 | 
				
			||||||
    ok = clean_logs([MainLog, SaslLog], Suffix),
 | 
					    ok = clean_logs([MainLog, SaslLog], Suffix),
 | 
				
			||||||
| 
						 | 
					@ -280,7 +280,7 @@ test_log_management() ->
 | 
				
			||||||
    ok = application:set_env(sasl, sasl_error_logger, {file, SaslLog}),
 | 
					    ok = application:set_env(sasl, sasl_error_logger, {file, SaslLog}),
 | 
				
			||||||
    ok = application:set_env(kernel, error_logger, {file, MainLog}),
 | 
					    ok = application:set_env(kernel, error_logger, {file, MainLog}),
 | 
				
			||||||
    ok = add_log_handlers([{rabbit_error_logger_file_h, MainLog},
 | 
					    ok = add_log_handlers([{rabbit_error_logger_file_h, MainLog},
 | 
				
			||||||
			   {rabbit_sasl_report_file_h, SaslLog}]),
 | 
					                           {rabbit_sasl_report_file_h, SaslLog}]),
 | 
				
			||||||
    passed.
 | 
					    passed.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_log_management_during_startup() ->
 | 
					test_log_management_during_startup() ->
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue