diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2013-02-25 10:32:29 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-02-25 10:32:29 +0000 |
| commit | b21dbefcf4be2f3395e903828da7beb713fd9ade (patch) | |
| tree | 310514496f32f093473dcf5590505da179f4bfdb | |
| parent | 8eff499387fe01afeeb8f6d22ab06a919918b779 (diff) | |
| download | rabbitmq-server-git-b21dbefcf4be2f3395e903828da7beb713fd9ade.tar.gz | |
continue accepting when client sends RST before we accepted
| -rw-r--r-- | src/tcp_acceptor.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tcp_acceptor.erl b/src/tcp_acceptor.erl index 0248f8787f..c76681c25e 100644 --- a/src/tcp_acceptor.erl +++ b/src/tcp_acceptor.erl @@ -61,15 +61,13 @@ handle_info({inet_async, LSock, Ref, {ok, Sock}}, %% accept more accept(State); -handle_info({inet_async, LSock, Ref, {error, closed}}, - State=#state{sock=LSock, ref=Ref}) -> - %% It would be wrong to attempt to restart the acceptor when we - %% know this will fail. - {stop, normal, State}; - handle_info({inet_async, LSock, Ref, {error, Reason}}, State=#state{sock=LSock, ref=Ref}) -> - {stop, {accept_failed, Reason}, State}; + case Reason of + closed -> {stop, normal, State}; %% listening socket closed + econnaborted -> accept(State); %% client sent RST before we accepted + _ -> {stop, {accept_failed, Reason}, State} + end; handle_info(_Info, State) -> {noreply, State}. |
