Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Commit

Permalink
amqp_connection: Start syntax_tools and compiler
Browse files Browse the repository at this point in the history
This is a follow-up commit to 712f7b3.

While here, remove some trailing whitespaces.

References #72 and rabbitmq/rabbitmq-common#149.
  • Loading branch information
dumbbell committed Nov 25, 2016
1 parent 712f7b3 commit 3663b05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/amqp_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ start() ->
%% * https://github.com/rabbitmq/rabbitmq-common/pull/149
application:start(syntax_tools),
application:start(compiler),
application:start(xmerl),
application:start(rabbit_common),
application:start(amqp_client).

Expand Down
9 changes: 5 additions & 4 deletions src/amqp_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ start(AmqpParams) ->
%% running in the same process space. If the port is set to 'undefined',
%% the default ports will be selected depending on whether this is a
%% normal or an SSL connection.
%% If ConnectionName is binary - it will be added to client_properties as
%% If ConnectionName is binary - it will be added to client_properties as
%% user specified connection name.
start(AmqpParams, ConnName) when ConnName == undefined; is_binary(ConnName) ->
ensure_started(),
Expand All @@ -175,13 +175,13 @@ start(AmqpParams, ConnName) when ConnName == undefined; is_binary(ConnName) ->
amqp_gen_connection:connect(Connection).

set_connection_name(undefined, Params) -> Params;
set_connection_name(ConnName,
set_connection_name(ConnName,
#amqp_params_network{client_properties = Props} = Params) ->
Params#amqp_params_network{
client_properties = [
{<<"connection_name">>, longstr, ConnName} | Props
]};
set_connection_name(ConnName,
set_connection_name(ConnName,
#amqp_params_direct{client_properties = Props} = Params) ->
Params#amqp_params_direct{
client_properties = [
Expand All @@ -195,7 +195,8 @@ set_connection_name(ConnName,
%% application controller is in the process of shutting down the very
%% application which is making this call.
ensure_started() ->
[ensure_started(App) || App <- [xmerl, rabbit_common, amqp_client]].
[ensure_started(App) || App <- [syntax_tools, compiler, xmerl,
rabbit_common, amqp_client]].

ensure_started(App) ->
case is_pid(application_controller:get_master(App)) andalso amqp_sup:is_ready() of
Expand Down

0 comments on commit 3663b05

Please sign in to comment.