Remove mod_http_bind and migration code to mod_bosh

This commit is contained in:
Paweł Chmielowski 2017-01-02 15:53:25 +01:00
parent 1bda40dac7
commit 769975f6d7
6 changed files with 139 additions and 1490 deletions

View File

@ -1041,6 +1041,7 @@ replace_module(mod_shared_roster_odbc) -> {mod_shared_roster, sql};
replace_module(mod_vcard_odbc) -> {mod_vcard, sql};
replace_module(mod_vcard_xupdate_odbc) -> {mod_vcard_xupdate, sql};
replace_module(mod_pubsub_odbc) -> {mod_pubsub, sql};
replace_module(mod_http_bind) -> mod_bosh;
replace_module(Module) ->
case is_elixir_module(Module) of
true -> expand_elixir_module(Module);

View File

@ -135,7 +135,7 @@ init({SockMod, Socket}, Opts) ->
false -> []
end,
Bind = case proplists:get_bool(http_bind, Opts) of
true -> [{[<<"http-bind">>], mod_http_bind}];
true -> [{[<<"http-bind">>], mod_bosh}];
false -> []
end,
XMLRPC = case proplists:get_bool(xmlrpc, Opts) of
@ -150,9 +150,14 @@ init({SockMod, Socket}, Opts) ->
({Path, Mod}) -> {Path, Mod}
end, Hs),
[{str:tokens(
iolist_to_binary(Path), <<"/">>),
Mod} || {Path, Mod} <- Hs1]
Hs2 = [{str:tokens(
iolist_to_binary(Path), <<"/">>),
Mod} || {Path, Mod} <- Hs1],
[{Path,
case Mod of
mod_http_bind -> mod_bosh;
_ -> Mod
end} || {Path, Mod} <- Hs2]
end, []),
RequestHandlers = DefinedHandlers ++ Captcha ++ Register ++
Admin ++ Bind ++ XMLRPC,

File diff suppressed because it is too large Load Diff

View File

@ -51,16 +51,14 @@
-include("ejabberd.hrl").
-include("logger.hrl").
-type sockmod() :: ejabberd_http_bind |
ejabberd_bosh |
-type sockmod() :: ejabberd_bosh |
ejabberd_http_ws |
gen_tcp | fast_tls | ezlib.
-type receiver() :: pid () | atom().
-type socket() :: pid() | inet:socket() |
fast_tls:tls_socket() |
ezlib:zlib_socket() |
ejabberd_bosh:bind_socket() |
ejabberd_http_bind:bind_socket().
ejabberd_bosh:bind_socket().
-record(socket_state, {sockmod = gen_tcp :: sockmod(),
socket = self() :: socket(),
@ -231,7 +229,6 @@ get_transport(#socket_state{sockmod = SockMod,
fast_tls -> tls_zlib
end;
ejabberd_bosh -> http_bind;
ejabberd_http_bind -> http_bind;
ejabberd_http_ws -> websocket
end.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long