diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2017-09-11 22:40:26 -0400 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2017-09-11 22:40:26 -0400 |
| commit | 10ad5468a345a7ea0dace97b147da7cbba6bbcce (patch) | |
| tree | 53945cf22762cb06911808b73b4eaf9e99fc05ea /src | |
| parent | 52ab32e5fb9c4465091a9b6e7305f66942607687 (diff) | |
| parent | 0527df37562453b20227ebafd2b49770f1f26eb4 (diff) | |
| download | rabbitmq-server-git-10ad5468a345a7ea0dace97b147da7cbba6bbcce.tar.gz | |
Merge branch 'stable'
Conflicts:
src/rabbit_direct.erl
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_direct.erl | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/rabbit_direct.erl b/src/rabbit_direct.erl index 26e8f4d452..074eed1f9a 100644 --- a/src/rabbit_direct.erl +++ b/src/rabbit_direct.erl @@ -86,26 +86,31 @@ connect(Creds, VHost, Protocol, Pid, Infos) -> AuthFun = auth_fun(Creds, VHost, ExtraAuthProps), case rabbit:is_running() of true -> - case is_over_connection_limit(VHost, Creds, Pid) of - true -> - {error, not_allowed}; - false -> - case is_vhost_alive(VHost, Creds, Pid) of - false -> - {error, {internal_error, vhost_is_down}}; + case whereis(rabbit_direct_client_sup) of + undefined -> + {error, broker_is_booting}; + _ -> + case is_over_connection_limit(VHost, Creds, Pid) of true -> - case AuthFun() of - {ok, User = #user{username = Username}} -> - notify_auth_result(Username, - user_authentication_success, []), - connect1(User, VHost, Protocol, Pid, Infos); - {refused, Username, Msg, Args} -> - notify_auth_result(Username, - user_authentication_failure, - [{error, rabbit_misc:format(Msg, Args)}]), - {error, {auth_failure, "Refused"}} - end - end + {error, not_allowed}; + false -> + case is_vhost_alive(VHost, Creds, Pid) of + false -> + {error, {internal_error, vhost_is_down}}; + true -> + case AuthFun() of + {ok, User = #user{username = Username}} -> + notify_auth_result(Username, + user_authentication_success, []), + connect1(User, VHost, Protocol, Pid, Infos); + {refused, Username, Msg, Args} -> + notify_auth_result(Username, + user_authentication_failure, + [{error, rabbit_misc:format(Msg, Args)}]), + {error, {auth_failure, "Refused"}} + end %% AuthFun() + end %% is_vhost_alive + end %% is_over_connection_limit end; false -> {error, broker_not_found_on_node} end. |
