1
Fix memory and port leaks in web administration
2
interface when TLS is enabled for the HTTP listener.
4
This issue is tracked upstream as EJAB-1119.
6
This changeset was introduced in revisions 2790, 2792 in
7
branch http://svn.process-one.net/ejabberd/branches/ejabberd-2.1.x
9
The first stable version containing the fix is 2.1.1.
11
--- a/src/web/ejabberd_http.erl (revision 2789)
12
+++ b/src/web/ejabberd_http.erl (revision 2792)
20
-include("ejabberd.hrl").
22
-include("ejabberd_http.hrl").
24
start(SockData, Opts) ->
25
supervisor:start_child(ejabberd_http_sup, [SockData, Opts]).
27
-start_link({SockMod, Socket}, Opts) ->
28
+start_link(SockData, Opts) ->
29
+ {ok, proc_lib:spawn_link(ejabberd_http, init, [SockData, Opts])}.
31
+init({SockMod, Socket}, Opts) ->
32
TLSEnabled = lists:member(tls, Opts),
33
TLSOpts = lists:filter(fun({certfile, _}) -> true;
36
?DEBUG("S: ~p~n", [RequestHandlers]),
38
?INFO_MSG("started: ~p", [{SockMod1, Socket1}]),
39
- {ok, proc_lib:spawn_link(ejabberd_http,
41
- [#state{sockmod = SockMod1,
43
- request_handlers = RequestHandlers}])}.
44
+ State = #state{sockmod = SockMod1,
46
+ request_handlers = RequestHandlers},
47
+ receive_headers(State).
50
become_controller(_Pid) ->