mirror of
https://github.com/internetee/epp_proxy.git
synced 2025-08-18 13:33:48 +02:00
Gracefully handle clients that close their connection after logout
Registrar portal behaves closes the connection on its own after sending logout command, we should not throw errors with those cases.
This commit is contained in:
parent
4bc8821472
commit
4830a7e5e2
1 changed files with 4 additions and 2 deletions
|
@ -101,8 +101,10 @@ handle_cast(process_command,
|
|||
%% On logout, close the socket.
|
||||
%% Else, go back to the beginning of the loop.
|
||||
if Command =:= "logout" ->
|
||||
ok = ssl:shutdown(Socket, read_write),
|
||||
{stop, normal, State};
|
||||
case ssl:shutdown(Socket, read_write) of
|
||||
ok -> {stop, normal, State};
|
||||
{error, closed} -> {stop, normal, State}
|
||||
end;
|
||||
true ->
|
||||
gen_server:cast(self(), process_command),
|
||||
{noreply,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue