mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Fix memory and port leak when TLS is enabled in HTTP (thanks to Brian Cully)(EJAB-1119)
SVN Revision: 2790
This commit is contained in:
parent
f044d6ed28
commit
1f5bf8fbc0
@ -35,6 +35,9 @@
|
|||||||
receive_headers/1,
|
receive_headers/1,
|
||||||
url_encode/1]).
|
url_encode/1]).
|
||||||
|
|
||||||
|
%% Callbacks
|
||||||
|
-export([init/2]).
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("jlib.hrl").
|
-include("jlib.hrl").
|
||||||
-include("ejabberd_http.hrl").
|
-include("ejabberd_http.hrl").
|
||||||
@ -79,7 +82,10 @@
|
|||||||
start(SockData, Opts) ->
|
start(SockData, Opts) ->
|
||||||
supervisor:start_child(ejabberd_http_sup, [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),
|
TLSEnabled = lists:member(tls, Opts),
|
||||||
TLSOpts = lists:filter(fun({certfile, _}) -> true;
|
TLSOpts = lists:filter(fun({certfile, _}) -> true;
|
||||||
(_) -> false
|
(_) -> false
|
||||||
|
Loading…
Reference in New Issue
Block a user