summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@rabbitmq.com>2014-08-11 15:06:39 +0400
committerMichael Klishin <michael@rabbitmq.com>2014-08-11 15:06:39 +0400
commit7d4e78ccdddd37aed98911db8bd83b373040598c (patch)
treec4fac1327c2b5e5c541ff6319d5007a54a5cfbcb /src
parent95c9cd57756aadc9dbbbeef8f6312f338ed7cf8e (diff)
downloadrabbitmq-server-git-7d4e78ccdddd37aed98911db8bd83b373040598c.tar.gz
Handle exceptions when connection_state = 'starting' the same way we do for 'tuning'
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_reader.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index e6e94e2828..b6afc1d062 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -596,7 +596,12 @@ 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 = #v1{connection_state = starting}, Channel, Reason) ->
+ fail_handshake_after_delay(State, Channel, Reason);
handle_exception(State = #v1{connection_state = tuning}, Channel, Reason) ->
+ fail_handshake_after_delay(State, Channel, Reason).
+
+fail_handshake_after_delay(State, 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),