diff options
author | Badlop <badlop@process-one.net> | 2009-12-07 17:33:02 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-12-07 17:33:02 +0000 |
commit | 1f5bf8fbc0f00847e931be0f54cc9fbc1b69f65a (patch) | |
tree | c9c2ea7f705313f33dc3acfd3ea0b990a87c1612 | |
parent | Fix bug that couldn't connect if starttls_required and zlib were set (EJAB-1118) (diff) |
Fix memory and port leak when TLS is enabled in HTTP (thanks to Brian Cully)(EJAB-1119)
SVN Revision: 2790
-rw-r--r-- | src/web/ejabberd_http.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl index bff4b4d45..085c5c3a3 100644 --- a/src/web/ejabberd_http.erl +++ b/src/web/ejabberd_http.erl @@ -35,6 +35,9 @@ receive_headers/1, url_encode/1]). +%% Callbacks +-export([init/2]). + -include("ejabberd.hrl"). -include("jlib.hrl"). -include("ejabberd_http.hrl"). @@ -79,7 +82,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 |