summaryrefslogtreecommitdiff
path: root/src/rabbit_reader.erl
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-09-03 16:31:35 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-09-03 16:31:35 +0100
commitfef645432aa37b98ab39d9c4203a067f86ca0932 (patch)
tree54acc9dd120134a3a445f57dc80fa5472344a57e /src/rabbit_reader.erl
parentd87576a6349a78a7d1ce2c88c737000f87df69ae (diff)
downloadrabbitmq-server-fef645432aa37b98ab39d9c4203a067f86ca0932.tar.gz
attempt to close ssl connections gracefully but forcefully
gracefully...so that there is a good chance of TLS alerts making it through, but forecfully (after a timeout) so we don't get stuck (or worse, silently) holding on to file descriptors and processes.
Diffstat (limited to 'src/rabbit_reader.erl')
-rw-r--r--src/rabbit_reader.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index bd20deb2..4bcb347d 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -184,6 +184,7 @@ socket_op(Sock, Fun) ->
{ok, Res} -> Res;
{error, Reason} -> log(error, "error on AMQP connection ~p: ~p~n",
[self(), Reason]),
+ rabbit_net:fast_close(Sock),
exit(normal)
end.
@@ -242,8 +243,7 @@ start_connection(Parent, ChannelSupSupPid, Collector, StartHeartbeatFun, Deb,
%% controlling process and hence its termination will close
%% the socket. However, to keep the file_handle_cache
%% accounting as accurate as possible we ought to close the
- %% socket w/o delay before termination. fast_close does that,
- %% though only for non-ssl sockets.
+ %% socket w/o delay before termination.
rabbit_net:fast_close(ClientSock),
rabbit_event:notify(connection_closed, [{pid, self()}])
end,