Compare commits
3 Commits
e3f0eaa24d
...
15828b697d
| Author | SHA1 | Date | |
|---|---|---|---|
| 15828b697d | |||
| 236eed5505 | |||
| 727c0aedd6 |
@@ -32,6 +32,10 @@ handle_info({ssl, Socket, Data}, State) ->
|
|||||||
ok
|
ok
|
||||||
end,
|
end,
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
handle_info({ssl_closed, _Socket}, State) ->
|
||||||
|
{stop, normal, State};
|
||||||
|
handle_info({ssl_error, _Socket, _Reason}, State) ->
|
||||||
|
{stop, normal, State};
|
||||||
handle_info(_Info, State) ->
|
handle_info(_Info, State) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ handle_cast(_Msg, State) ->
|
|||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info(accept, State = #state{socket = Socket}) ->
|
handle_info(accept, State = #state{socket = Socket}) ->
|
||||||
case ssl:transport_accept(Socket) of
|
case ssl:transport_accept(Socket, 5000) of
|
||||||
{ok, TlsSocket} ->
|
{ok, TlsSocket} ->
|
||||||
self() ! {handshake, TlsSocket},
|
self() ! {handshake, TlsSocket},
|
||||||
self() ! accept;
|
self() ! accept;
|
||||||
@@ -39,7 +39,7 @@ handle_info(accept, State = #state{socket = Socket}) ->
|
|||||||
end,
|
end,
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
handle_info({handshake, TlsSocket}, State) ->
|
handle_info({handshake, TlsSocket}, State) ->
|
||||||
case ssl:handshake(TlsSocket) of
|
case ssl:handshake(TlsSocket, 5000) of
|
||||||
{ok, ClientSocket} ->
|
{ok, ClientSocket} ->
|
||||||
{ok, Pid} = session_sup:start_session(ClientSocket),
|
{ok, Pid} = session_sup:start_session(ClientSocket),
|
||||||
ok = ssl:controlling_process(ClientSocket, Pid);
|
ok = ssl:controlling_process(ClientSocket, Pid);
|
||||||
|
|||||||
Reference in New Issue
Block a user