25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

do not forget to close TLS socket

SVN Revision: 2451
This commit is contained in:
Evgeniy Khramtsov 2009-08-10 02:20:05 +00:00
parent 73fabfe3a6
commit d967054a9f

View File

@ -143,15 +143,14 @@ handle_info({tcp, Sock, TLSData}, wait_for_tls, State) ->
<<_:16, 1, _/binary>> ->
TLSOpts = [{certfile, State#state.certfile}],
{ok, TLSSock} = tls:tcp_to_tls(Sock, TLSOpts),
NewState = State#state{sock = TLSSock,
buf = <<>>,
sock_mod = tls},
case tls:recv_data(TLSSock, Buf) of
{ok, Data} ->
process_data(session_established,
State#state{sock = TLSSock,
buf = <<>>,
sock_mod = tls},
Data);
process_data(session_established, NewState, Data);
_Err ->
{stop, normal, State}
{stop, normal, NewState}
end;
_ ->
process_data(session_established, State, TLSData)