summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@rabbitmq.com>2014-08-01 11:41:49 +0400
committerMichael Klishin <michael@rabbitmq.com>2014-08-01 11:41:49 +0400
commitacccf9bf90fae52d7a3936f11caa360ce6f1c7c0 (patch)
tree5fa186e1d43eb546a028e831ec989218d13424d3
parentb6cf9ae52c07a8af3128c2c2e1ce34bb68abf53f (diff)
parent3af6703c3cbdb80e85600aac7072ecebffcf3822 (diff)
downloadrabbitmq-server-git-acccf9bf90fae52d7a3936f11caa360ce6f1c7c0.tar.gz
merge heads
-rw-r--r--src/rabbit_reader.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index ddaf205e7d..fd5dc20810 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -596,10 +596,13 @@ handle_exception(State = #v1{connection = #connection{protocol = Protocol},
State1 = close_connection(terminate_channels(State)),
ok = send_on_channel0(State1#v1.sock, CloseMethod, Protocol),
State1;
-handle_exception(State, Channel, Reason) ->
+handle_exception(State = #v1{connection_state = tuning,
+ connection = #connection{name = S}}, Channel, Reason) ->
%% We don't trust the client at this point - force them to wait
%% for a bit so they can't DOS us with repeated failed logins etc.
timer:sleep(?SILENT_CLOSE_DELAY * 1000),
+ log(error, "AMQP connection ~p (~s) handshake error:~n~p~n",
+ [self(), S, Reason]),
throw({handshake_error, State#v1.connection_state, Channel, Reason}).
%% we've "lost sync" with the client and hence must not accept any
@@ -971,7 +974,8 @@ validate_negotiated_integer_value(Field, Min, ClientValue) ->
ServerValue = get_env(Field),
if ClientValue /= 0 andalso ClientValue < Min ->
fail_negotiation(Field, min, ServerValue, ClientValue);
- ServerValue /= 0 andalso ClientValue > ServerValue ->
+ ServerValue /= 0 andalso (ClientValue =:= 0 orelse
+ ClientValue > ServerValue) ->
fail_negotiation(Field, max, ServerValue, ClientValue);
true ->
ok