summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-06-24 16:17:30 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-06-24 16:17:30 +0100
commitfc6737d5450fea892694ae25546cf791150207c2 (patch)
tree7c1d3a2e1f28bcface90a52289676913a337dede
parent8e9a63a39c5eece42fd30ee71ea1b684c2d1af4c (diff)
downloadrabbitmq-server-bug26148.tar.gz
Cosmetic: unwrap several lines. Remove some more binary_to_list/1.bug26148
-rw-r--r--src/rabbit_channel.erl18
-rw-r--r--src/rabbit_reader.erl16
2 files changed, 13 insertions, 21 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 0c012898..8d5af9d7 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -433,23 +433,21 @@ send(_Command, #ch{state = closing}) ->
send(Command, #ch{writer_pid = WriterPid}) ->
ok = rabbit_writer:send_command(WriterPid, Command).
-handle_exception(Reason, State = #ch{protocol = Protocol,
- channel = Channel,
- writer_pid = WriterPid,
- reader_pid = ReaderPid,
- conn_pid = ConnPid,
- conn_name = ConnName,
+handle_exception(Reason, State = #ch{protocol = Protocol,
+ channel = Channel,
+ writer_pid = WriterPid,
+ reader_pid = ReaderPid,
+ conn_pid = ConnPid,
+ conn_name = ConnName,
virtual_host = VHost,
- user = User
- }) ->
+ user = User}) ->
%% something bad's happened: notify_queues may not be 'ok'
{_Result, State1} = notify_queues(State),
case rabbit_binary_generator:map_exception(Channel, Reason, Protocol) of
{Channel, CloseMethod} ->
rabbit_log:error("Channel error on connection ~p (~s, vhost: '~s',"
" user: '~s'), channel ~p:~n~p~n",
- [ConnPid, ConnName, binary_to_list(VHost),
- binary_to_list(User#user.username),
+ [ConnPid, ConnName, VHost, User#user.username,
Channel, Reason]),
ok = rabbit_writer:send_command(WriterPid, CloseMethod),
{noreply, State1};
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 61d15707..c121f10e 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -559,19 +559,16 @@ wait_for_channel_termination(N, TimerRef,
{Channel, State1} = channel_cleanup(ChPid, State),
case {Channel, termination_kind(Reason)} of
{undefined, _} ->
- exit({abnormal_dependent_exit,
- ChPid, Reason});
+ exit({abnormal_dependent_exit, ChPid, Reason});
{_, controlled} ->
- wait_for_channel_termination(
- N-1, TimerRef, State1);
+ wait_for_channel_termination(N-1, TimerRef, State1);
{_, uncontrolled} ->
log(error, "Error on AMQP connection ~p (~s, vhost: '~s',"
" user: '~s', state: ~p), channel ~p:"
"error while terminating:~n~p~n",
[self(), ConnName, VHost, User#user.username,
CS, Channel, Reason]),
- wait_for_channel_termination(
- N-1, TimerRef, State1)
+ wait_for_channel_termination(N-1, TimerRef, State1)
end;
cancel_wait ->
exit(channel_termination_timeout)
@@ -594,14 +591,11 @@ log_hard_error(#v1{connection_state = CS,
connection = #connection{
name = ConnName,
user = User,
- vhost = VHost}},
- Channel, Reason) ->
+ vhost = VHost}}, Channel, Reason) ->
log(error,
"Error on AMQP connection ~p (~s, vhost: '~s',"
" user: '~s', state: ~p), channel ~p:~n~p~n",
- [self(), ConnName,
- VHost, User#user.username,
- CS, Channel, Reason]).
+ [self(), ConnName, VHost, User#user.username, CS, Channel, Reason]).
handle_exception(State = #v1{connection_state = closed}, Channel, Reason) ->
log_hard_error(State, Channel, Reason),