24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-09-27 14:30:55 +02:00

Fix memory and port leak when TLS is enabled in HTTP (thanks to Brian Cully)(EJAB-1119)

SVN Revision: 2791
This commit is contained in:
Badlop 2009-12-07 17:34:52 +00:00
parent efd99f5b28
commit 21a36819b0

View File

@ -35,6 +35,9 @@
receive_headers/1,
url_encode/1]).
%% Callbacks
-export([init/2]).
-include_lib("exmpp/include/exmpp.hrl").
-include("ejabberd.hrl").
@ -83,7 +86,10 @@
start(SockData, Opts) ->
supervisor:start_child(ejabberd_http_sup, [SockData, Opts]).
start_link({SockMod, Socket}, Opts) ->
start_link(SockData, Opts) ->
{ok, proc_lib:spawn_link(ejabberd_http, init, [SockData, Opts])}.
init({SockMod, Socket}, Opts) ->
TLSEnabled = lists:member(tls, Opts),
TLSOpts = lists:filter(fun({certfile, _}) -> true;
(_) -> false