Browse Source

Don't report error on ssl {error, closed}

SSL socket might be closed on accept_ack, it happens quite often
and it is not a problem, so don't report error on the case.
Jihyun Yu 10 years ago
parent
commit
b0dc8bf6a1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/ranch_ssl.erl

+ 1 - 1
src/ranch_ssl.erl

@@ -107,7 +107,7 @@ accept_ack(CSocket, Timeout) ->
 			ok = close(CSocket),
 			ok = close(CSocket),
 			exit(normal);
 			exit(normal);
 		%% Socket most likely stopped responding, don't error out.
 		%% Socket most likely stopped responding, don't error out.
-		{error, timeout} ->
+		{error, Reason} when Reason =:= timeout; Reason =:= closed ->
 			ok = close(CSocket),
 			ok = close(CSocket),
 			exit(normal);
 			exit(normal);
 		{error, Reason} ->
 		{error, Reason} ->