* src/ejabberd_s2s_out.erl: Close connection after key
verification * src/ejabberd_c2s.erl: start replaced with start_link * src/ejabberd_s2s_in.erl: Likewise * src/ejabberd_s2s_out.erl: Likewise * src/ejabberd_service.erl: Likewise * src/ejabberd_listener.erl: Now uses proc_lib to spawn listeners, removed 3rd parameter in listener configuration (assumed to equal start_link) * src/ejabberd.rel: Updated * doc/guide.tex: Small changes * doc/Makefile: Added implicit charset specification to hevea SVN Revision: 124
This commit is contained in:
parent
3131c08155
commit
1834fb3a72
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
||||||
|
2003-07-14 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/ejabberd_s2s_out.erl: Close connection after key
|
||||||
|
verification
|
||||||
|
|
||||||
|
* src/ejabberd_c2s.erl: start replaced with start_link
|
||||||
|
* src/ejabberd_s2s_in.erl: Likewise
|
||||||
|
* src/ejabberd_s2s_out.erl: Likewise
|
||||||
|
* src/ejabberd_service.erl: Likewise
|
||||||
|
|
||||||
|
* src/ejabberd_listener.erl: Now uses proc_lib to spawn listeners,
|
||||||
|
removed 3rd parameter in listener configuration (assumed to equal
|
||||||
|
start_link)
|
||||||
|
|
||||||
|
* src/ejabberd.rel: Updated
|
||||||
|
|
||||||
|
* doc/guide.tex: Small changes
|
||||||
|
|
||||||
|
* doc/Makefile: Added implicit charset specification to hevea
|
||||||
|
|
||||||
2003-07-12 Alexey Shchepin <alexey@sevcom.net>
|
2003-07-12 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
* doc/guide.tex: Updated (thanks to Sergei Golovan)
|
* doc/guide.tex: Updated (thanks to Sergei Golovan)
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
<HTML>
|
<HTML>
|
||||||
<HEAD><TITLE>Ejabberd Installation and Operation Guide</TITLE>
|
<HEAD><TITLE>Ejabberd Installation and Operation Guide</TITLE>
|
||||||
|
|
||||||
<META http-equiv="Content-Type" content="text/html; charset=KOI8-R">
|
<META http-equiv="Content-Type" content="text/html; charset=ISO8859-1">
|
||||||
<META name="GENERATOR" content="hevea 1.06">
|
<META name="GENERATOR" content="hevea 1.06">
|
||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY >
|
<BODY >
|
||||||
<!--HEVEA command line is: /usr/bin/hevea guide.tex -->
|
<!--HEVEA command line is: /usr/bin/hevea -charset ISO8859-1 guide.tex -->
|
||||||
<!--HTMLHEAD-->
|
<!--HTMLHEAD-->
|
||||||
<!--ENDHTML-->
|
<!--ENDHTML-->
|
||||||
<!--PREFIX <ARG ></ARG>-->
|
<!--PREFIX <ARG ></ARG>-->
|
||||||
|
@ -115,9 +115,9 @@ The main features of <TT>ejabberd</TT> is:
|
||||||
<UL><LI>
|
<UL><LI>
|
||||||
Works on most of popular platforms: *nix (tested on Linux and FreeBSD)
|
Works on most of popular platforms: *nix (tested on Linux and FreeBSD)
|
||||||
and Win32
|
and Win32
|
||||||
<LI>Distributed: You may run <TT>ejabberd</TT> on a cluster of machines and all of
|
<LI>Distributed: You can run <TT>ejabberd</TT> on a cluster of machines and all of
|
||||||
them will serve one Jabber domain.
|
them will serve one Jabber domain.
|
||||||
<LI>Fault-tolerance: You may setup an <TT>ejabberd</TT> cluster so that all the
|
<LI>Fault-tolerance: You can setup an <TT>ejabberd</TT> cluster so that all the
|
||||||
information required for a properly working service will be stored
|
information required for a properly working service will be stored
|
||||||
permanently on more than one node. This means that if one of the nodes
|
permanently on more than one node. This means that if one of the nodes
|
||||||
crashes, then the others will continue working without disruption.
|
crashes, then the others will continue working without disruption.
|
||||||
|
@ -211,8 +211,9 @@ TBD<BR>
|
||||||
<OL type=1><LI>
|
<OL type=1><LI>
|
||||||
Install Erlang emulator (for example, into <CODE>C:\Program Files\erl5.1.2</CODE>).
|
Install Erlang emulator (for example, into <CODE>C:\Program Files\erl5.1.2</CODE>).
|
||||||
<LI>Install Expat library into <CODE>C:\Program Files\Expat-1.95.6</CODE>
|
<LI>Install Expat library into <CODE>C:\Program Files\Expat-1.95.6</CODE>
|
||||||
directory. Copy file <CODE>C:\Program Files\Expat-1.95.6\Libs\libexpat.dll</CODE> to your Windows system directory (for
|
directory. Copy file <CODE>C:\Program Files\Expat-1.95.6\Libs\libexpat.dll</CODE>
|
||||||
example, <CODE>C:\WINNT</CODE> or <CODE>C:\WINNT\System32</CODE>)
|
to your Windows system directory (for example, <CODE>C:\WINNT</CODE> or
|
||||||
|
<CODE>C:\WINNT\System32</CODE>)
|
||||||
<LI>Install Iconv library into <CODE>C:\Program Files\GnuWin32</CODE> directory.
|
<LI>Install Iconv library into <CODE>C:\Program Files\GnuWin32</CODE> directory.
|
||||||
Copy file <CODE>C:\Program Files\GnuWin32\bin\libiconv-2.dll</CODE> to your
|
Copy file <CODE>C:\Program Files\GnuWin32\bin\libiconv-2.dll</CODE> to your
|
||||||
Windows system directory.<BR>
|
Windows system directory.<BR>
|
||||||
|
@ -236,6 +237,11 @@ nmake -f Makefile.win32
|
||||||
werl -s ejabberd -name ejabberd
|
werl -s ejabberd -name ejabberd
|
||||||
</PRE><LI>Enjoy!
|
</PRE><LI>Enjoy!
|
||||||
</OL>
|
</OL>
|
||||||
|
Some recent versions of Erlang distribution it seems have bug in crypto
|
||||||
|
application, so ejabberd could be built but users can't use digest
|
||||||
|
authentication (only plain-text). Also it seems SSL support is broken in
|
||||||
|
Windows distribution of Erlang emulator.<BR>
|
||||||
|
<BR>
|
||||||
<!--TOC subsection Starting-->
|
<!--TOC subsection Starting-->
|
||||||
|
|
||||||
<H3><A NAME="htoc10">2.4</A> Starting</H3><!--SEC END -->
|
<H3><A NAME="htoc10">2.4</A> Starting</H3><!--SEC END -->
|
||||||
|
|
|
@ -64,9 +64,9 @@ The main features of \ejabberd{} is:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item Works on most of popular platforms: *nix (tested on Linux and FreeBSD)
|
\item Works on most of popular platforms: *nix (tested on Linux and FreeBSD)
|
||||||
and Win32
|
and Win32
|
||||||
\item Distributed: You may run \ejabberd{} on a cluster of machines and all of
|
\item Distributed: You can run \ejabberd{} on a cluster of machines and all of
|
||||||
them will serve one Jabber domain.
|
them will serve one Jabber domain.
|
||||||
\item Fault-tolerance: You may setup an \ejabberd{} cluster so that all the
|
\item Fault-tolerance: You can setup an \ejabberd{} cluster so that all the
|
||||||
information required for a properly working service will be stored
|
information required for a properly working service will be stored
|
||||||
permanently on more than one node. This means that if one of the nodes
|
permanently on more than one node. This means that if one of the nodes
|
||||||
crashes, then the others will continue working without disruption.
|
crashes, then the others will continue working without disruption.
|
||||||
|
|
|
@ -38,13 +38,14 @@
|
||||||
|
|
||||||
{host, "e.localhost"}.
|
{host, "e.localhost"}.
|
||||||
|
|
||||||
{listen, [{5522, ejabberd_c2s, start, [{access, c2s},
|
{listen, [{5522, ejabberd_c2s, [{access, c2s},
|
||||||
{shaper, c2s_shaper}]},
|
{shaper, c2s_shaper}]},
|
||||||
{5523, ejabberd_c2s, start,
|
{5523, ejabberd_c2s, [{access, c2s},
|
||||||
[{access, c2s}, {ssl, [{certfile, "./ssl.pem"}]}]},
|
{ssl, [{certfile, "./ssl.pem"}]}]},
|
||||||
{5269, ejabberd_s2s_in, start, []},
|
{5269, ejabberd_s2s_in, []},
|
||||||
{8888, ejabberd_service, start,
|
{8888, ejabberd_service, [{host,
|
||||||
[{host, "conference.e.localhost", [{password, "asdqwe"}]}]}
|
"conference.e.localhost",
|
||||||
|
[{password, "asdqwe"}]}]}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
% This value (5569) is only for debugging, must be 5269
|
% This value (5569) is only for debugging, must be 5269
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
-behaviour(gen_fsm).
|
-behaviour(gen_fsm).
|
||||||
|
|
||||||
%% External exports
|
%% External exports
|
||||||
-export([start/2, receiver/4, send_text/2, send_element/2]).
|
-export([start_link/2, receiver/4, send_text/2, send_element/2]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
-export([init/1,
|
-export([init/1,
|
||||||
|
@ -77,8 +77,8 @@
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
gen_fsm:start(ejabberd_c2s, [SockData, Opts], ?FSMOPTS).
|
gen_fsm:start_link(ejabberd_c2s, [SockData, Opts], ?FSMOPTS).
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Callback functions from gen_fsm
|
%%% Callback functions from gen_fsm
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
-author('alexey@sevcom.net').
|
-author('alexey@sevcom.net').
|
||||||
-vsn('$Revision$ ').
|
-vsn('$Revision$ ').
|
||||||
|
|
||||||
-export([start_link/0, init/1, start/4,
|
-export([start_link/0, init/1, start/3,
|
||||||
init/4,
|
init/3,
|
||||||
init_ssl/5
|
init_ssl/4
|
||||||
]).
|
]).
|
||||||
|
|
||||||
start_link() ->
|
start_link() ->
|
||||||
|
@ -26,9 +26,9 @@ init(_) ->
|
||||||
Ls ->
|
Ls ->
|
||||||
{ok, {{one_for_one, 10, 1},
|
{ok, {{one_for_one, 10, 1},
|
||||||
lists:map(
|
lists:map(
|
||||||
fun({Port, Module, Fun, Opts}) ->
|
fun({Port, Module, Opts}) ->
|
||||||
{Port,
|
{Port,
|
||||||
{?MODULE, start, [Port, Module, Fun, Opts]},
|
{?MODULE, start, [Port, Module, Opts]},
|
||||||
permanent,
|
permanent,
|
||||||
brutal_kill,
|
brutal_kill,
|
||||||
worker,
|
worker,
|
||||||
|
@ -37,32 +37,32 @@ init(_) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
start(Port, Module, Fun, Opts) ->
|
start(Port, Module, Opts) ->
|
||||||
case lists:keysearch(ssl, 1, Opts) of
|
case lists:keysearch(ssl, 1, Opts) of
|
||||||
{value, {ssl, SSLOpts}} ->
|
{value, {ssl, SSLOpts}} ->
|
||||||
{ok, spawn_link(?MODULE, init_ssl,
|
{ok, proc_lib:spawn_link(?MODULE, init_ssl,
|
||||||
[Port, Module, Fun, Opts, SSLOpts])};
|
[Port, Module, Opts, SSLOpts])};
|
||||||
_ ->
|
_ ->
|
||||||
{ok, spawn_link(?MODULE, init, [Port, Module, Fun, Opts])}
|
{ok, proc_lib:spawn_link(?MODULE, init, [Port, Module, Opts])}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
init(Port, Module, Fun, Opts) ->
|
init(Port, Module, Opts) ->
|
||||||
{ok, ListenSocket} = gen_tcp:listen(Port, [binary,
|
{ok, ListenSocket} = gen_tcp:listen(Port, [binary,
|
||||||
{packet, 0},
|
{packet, 0},
|
||||||
{active, false},
|
{active, false},
|
||||||
{reuseaddr, true}]),
|
{reuseaddr, true}]),
|
||||||
accept(ListenSocket, Module, Fun, Opts).
|
accept(ListenSocket, Module, Opts).
|
||||||
|
|
||||||
accept(ListenSocket, Module, Fun, Opts) ->
|
accept(ListenSocket, Module, Opts) ->
|
||||||
case gen_tcp:accept(ListenSocket) of
|
case gen_tcp:accept(ListenSocket) of
|
||||||
{ok, Socket} ->
|
{ok, Socket} ->
|
||||||
{ok, Pid} = apply(Module, Fun, [{gen_tcp, Socket}, Opts]),
|
{ok, Pid} = apply(Module, start_link, [{gen_tcp, Socket}, Opts]),
|
||||||
gen_tcp:controlling_process(Socket, Pid),
|
gen_tcp:controlling_process(Socket, Pid),
|
||||||
accept(ListenSocket, Module, Fun, Opts)
|
accept(ListenSocket, Module, Opts)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
init_ssl(Port, Module, Fun, Opts, SSLOpts) ->
|
init_ssl(Port, Module, Opts, SSLOpts) ->
|
||||||
{ok, ListenSocket} = ssl:listen(Port, [binary,
|
{ok, ListenSocket} = ssl:listen(Port, [binary,
|
||||||
{packet, 0},
|
{packet, 0},
|
||||||
{active, false},
|
{active, false},
|
||||||
|
@ -70,13 +70,13 @@ init_ssl(Port, Module, Fun, Opts, SSLOpts) ->
|
||||||
{backlog, 0},
|
{backlog, 0},
|
||||||
{cachetimout, 0} |
|
{cachetimout, 0} |
|
||||||
SSLOpts]),
|
SSLOpts]),
|
||||||
accept_ssl(ListenSocket, Module, Fun, Opts).
|
accept_ssl(ListenSocket, Module, Opts).
|
||||||
|
|
||||||
accept_ssl(ListenSocket, Module, Fun, Opts) ->
|
accept_ssl(ListenSocket, Module, Opts) ->
|
||||||
case ssl:accept(ListenSocket) of
|
case ssl:accept(ListenSocket) of
|
||||||
{ok, Socket} ->
|
{ok, Socket} ->
|
||||||
apply(Module, Fun, [{ssl, Socket}, Opts]),
|
apply(Module, start_link, [{ssl, Socket}, Opts]),
|
||||||
accept_ssl(ListenSocket, Module, Fun, Opts)
|
accept_ssl(ListenSocket, Module, Opts)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ do_route(From, To, Packet) ->
|
||||||
ok;
|
ok;
|
||||||
{atomic, new} ->
|
{atomic, new} ->
|
||||||
?DEBUG("starting new s2s connection~n", []),
|
?DEBUG("starting new s2s connection~n", []),
|
||||||
Pid = ejabberd_s2s_out:start(MyServer, Server, {new, Key}),
|
Pid = ejabberd_s2s_out:start_link(MyServer, Server, {new, Key}),
|
||||||
mnesia:transaction(fun() ->
|
mnesia:transaction(fun() ->
|
||||||
mnesia:write(#local_s2s{fromto = FromTo,
|
mnesia:write(#local_s2s{fromto = FromTo,
|
||||||
pid = Pid})
|
pid = Pid})
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
-behaviour(gen_fsm).
|
-behaviour(gen_fsm).
|
||||||
|
|
||||||
%% External exports
|
%% External exports
|
||||||
-export([start/2, receiver/2, send_text/2, send_element/2]).
|
-export([start_link/2, receiver/2, send_text/2, send_element/2]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
-export([init/1,
|
-export([init/1,
|
||||||
|
@ -63,8 +63,8 @@
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
gen_fsm:start(ejabberd_s2s_in, [SockData], ?FSMOPTS).
|
gen_fsm:start_link(ejabberd_s2s_in, [SockData], ?FSMOPTS).
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Callback functions from gen_fsm
|
%%% Callback functions from gen_fsm
|
||||||
|
@ -134,8 +134,8 @@ wait_for_key({xmlstreamelement, El}, StateData) ->
|
||||||
?INFO_MSG("GET KEY: ~p", [{To, From, Id, Key}]),
|
?INFO_MSG("GET KEY: ~p", [{To, From, Id, Key}]),
|
||||||
case lists:member(To, ejabberd_router:dirty_get_all_domains()) of
|
case lists:member(To, ejabberd_router:dirty_get_all_domains()) of
|
||||||
true ->
|
true ->
|
||||||
ejabberd_s2s_out:start(To, From,
|
ejabberd_s2s_out:start_link(To, From,
|
||||||
{verify, self(), Key}),
|
{verify, self(), Key}),
|
||||||
{next_state,
|
{next_state,
|
||||||
wait_for_verification,
|
wait_for_verification,
|
||||||
StateData#state{myname = To,
|
StateData#state{myname = To,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
-behaviour(gen_fsm).
|
-behaviour(gen_fsm).
|
||||||
|
|
||||||
%% External exports
|
%% External exports
|
||||||
-export([start/3, send_text/2, send_element/2]).
|
-export([start_link/3, send_text/2, send_element/2]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
-export([init/1,
|
-export([init/1,
|
||||||
|
@ -65,8 +65,9 @@
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(From, Host, Type) ->
|
start_link(From, Host, Type) ->
|
||||||
{ok, Pid} = gen_fsm:start(ejabberd_s2s_out, [From, Host, Type], ?FSMOPTS),
|
{ok, Pid} = gen_fsm:start_link(ejabberd_s2s_out, [From, Host, Type],
|
||||||
|
?FSMOPTS),
|
||||||
Pid.
|
Pid.
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
|
@ -212,13 +213,7 @@ wait_for_validation({xmlstreamelement, El}, StateData) ->
|
||||||
_ ->
|
_ ->
|
||||||
gen_fsm:send_event(Pid, invalid)
|
gen_fsm:send_event(Pid, invalid)
|
||||||
end,
|
end,
|
||||||
case StateData#state.verify of
|
{stop, normal, StateData}
|
||||||
false ->
|
|
||||||
{stop, normal, StateData};
|
|
||||||
_ ->
|
|
||||||
{next_state, wait_for_validation,
|
|
||||||
StateData#state{verify = false}, ?S2STIMEOUT}
|
|
||||||
end
|
|
||||||
end;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
{next_state, wait_for_validation, StateData, ?S2STIMEOUT}
|
{next_state, wait_for_validation, StateData, ?S2STIMEOUT}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
-behaviour(gen_fsm).
|
-behaviour(gen_fsm).
|
||||||
|
|
||||||
%% External exports
|
%% External exports
|
||||||
-export([start/2, receiver/2, send_text/2, send_element/2]).
|
-export([start_link/2, receiver/2, send_text/2, send_element/2]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
-export([init/1,
|
-export([init/1,
|
||||||
|
@ -69,8 +69,8 @@
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
gen_fsm:start(ejabberd_service, [SockData, Opts], ?FSMOPTS).
|
gen_fsm:start_link(ejabberd_service, [SockData, Opts], ?FSMOPTS).
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Callback functions from gen_fsm
|
%%% Callback functions from gen_fsm
|
||||||
|
|
Loading…
Reference in New Issue