diff options
author | Alexey Shchepin <alexey@process-one.net> | 2003-07-14 18:06:03 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2003-07-14 18:06:03 +0000 |
commit | 1834fb3a724365d804f5c863a27b720ac9bf45b9 (patch) | |
tree | d92dc73da4838b5bd2bd6e22fe4f21ca423f4874 | |
parent | * doc/guide.tex: Updated (thanks to Sergei Golovan) (diff) |
* 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
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | doc/guide.html | 18 | ||||
-rw-r--r-- | doc/guide.tex | 4 | ||||
-rw-r--r-- | src/ejabberd.cfg | 15 | ||||
-rw-r--r-- | src/ejabberd_c2s.erl | 6 | ||||
-rw-r--r-- | src/ejabberd_listener.erl | 38 | ||||
-rw-r--r-- | src/ejabberd_s2s.erl | 2 | ||||
-rw-r--r-- | src/ejabberd_s2s_in.erl | 10 | ||||
-rw-r--r-- | src/ejabberd_s2s_out.erl | 15 | ||||
-rw-r--r-- | src/ejabberd_service.erl | 6 |
10 files changed, 78 insertions, 56 deletions
@@ -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> * doc/guide.tex: Updated (thanks to Sergei Golovan) diff --git a/doc/guide.html b/doc/guide.html index ab393ed7..24141254 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -3,11 +3,11 @@ <HTML> <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"> </HEAD> <BODY > -<!--HEVEA command line is: /usr/bin/hevea guide.tex --> +<!--HEVEA command line is: /usr/bin/hevea -charset ISO8859-1 guide.tex --> <!--HTMLHEAD--> <!--ENDHTML--> <!--PREFIX <ARG ></ARG>--> @@ -115,9 +115,9 @@ The main features of <TT>ejabberd</TT> is: <UL><LI> Works on most of popular platforms: *nix (tested on Linux and FreeBSD) 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. -<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 permanently on more than one node. This means that if one of the nodes crashes, then the others will continue working without disruption. @@ -211,8 +211,9 @@ TBD<BR> <OL type=1><LI> 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> - directory. Copy file <CODE>C:\Program Files\Expat-1.95.6\Libs\libexpat.dll</CODE> to your Windows system directory (for - example, <CODE>C:\WINNT</CODE> or <CODE>C:\WINNT\System32</CODE>) + directory. Copy file <CODE>C:\Program Files\Expat-1.95.6\Libs\libexpat.dll</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. Copy file <CODE>C:\Program Files\GnuWin32\bin\libiconv-2.dll</CODE> to your Windows system directory.<BR> @@ -236,6 +237,11 @@ nmake -f Makefile.win32 werl -s ejabberd -name ejabberd </PRE><LI>Enjoy! </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--> <H3><A NAME="htoc10">2.4</A> Starting</H3><!--SEC END --> diff --git a/doc/guide.tex b/doc/guide.tex index 0142437d..0c0a6d0f 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -64,9 +64,9 @@ The main features of \ejabberd{} is: \begin{itemize} \item Works on most of popular platforms: *nix (tested on Linux and FreeBSD) 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. -\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 permanently on more than one node. This means that if one of the nodes crashes, then the others will continue working without disruption. diff --git a/src/ejabberd.cfg b/src/ejabberd.cfg index 57dc4bc0..8e82f274 100644 --- a/src/ejabberd.cfg +++ b/src/ejabberd.cfg @@ -38,13 +38,14 @@ {host, "e.localhost"}. -{listen, [{5522, ejabberd_c2s, start, [{access, c2s}, - {shaper, c2s_shaper}]}, - {5523, ejabberd_c2s, start, - [{access, c2s}, {ssl, [{certfile, "./ssl.pem"}]}]}, - {5269, ejabberd_s2s_in, start, []}, - {8888, ejabberd_service, start, - [{host, "conference.e.localhost", [{password, "asdqwe"}]}]} +{listen, [{5522, ejabberd_c2s, [{access, c2s}, + {shaper, c2s_shaper}]}, + {5523, ejabberd_c2s, [{access, c2s}, + {ssl, [{certfile, "./ssl.pem"}]}]}, + {5269, ejabberd_s2s_in, []}, + {8888, ejabberd_service, [{host, + "conference.e.localhost", + [{password, "asdqwe"}]}]} ]}. % This value (5569) is only for debugging, must be 5269 diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index fb6bec27..b8ccc1ef 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -13,7 +13,7 @@ -behaviour(gen_fsm). %% 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 -export([init/1, @@ -77,8 +77,8 @@ %%%---------------------------------------------------------------------- %%% API %%%---------------------------------------------------------------------- -start(SockData, Opts) -> - gen_fsm:start(ejabberd_c2s, [SockData, Opts], ?FSMOPTS). +start_link(SockData, Opts) -> + gen_fsm:start_link(ejabberd_c2s, [SockData, Opts], ?FSMOPTS). %%%---------------------------------------------------------------------- %%% Callback functions from gen_fsm diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index ffa9cbb1..04985060 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -10,9 +10,9 @@ -author('alexey@sevcom.net'). -vsn('$Revision$ '). --export([start_link/0, init/1, start/4, - init/4, - init_ssl/5 +-export([start_link/0, init/1, start/3, + init/3, + init_ssl/4 ]). start_link() -> @@ -26,9 +26,9 @@ init(_) -> Ls -> {ok, {{one_for_one, 10, 1}, lists:map( - fun({Port, Module, Fun, Opts}) -> + fun({Port, Module, Opts}) -> {Port, - {?MODULE, start, [Port, Module, Fun, Opts]}, + {?MODULE, start, [Port, Module, Opts]}, permanent, brutal_kill, worker, @@ -37,32 +37,32 @@ init(_) -> end. -start(Port, Module, Fun, Opts) -> +start(Port, Module, Opts) -> case lists:keysearch(ssl, 1, Opts) of {value, {ssl, SSLOpts}} -> - {ok, spawn_link(?MODULE, init_ssl, - [Port, Module, Fun, Opts, SSLOpts])}; + {ok, proc_lib:spawn_link(?MODULE, init_ssl, + [Port, Module, Opts, SSLOpts])}; _ -> - {ok, spawn_link(?MODULE, init, [Port, Module, Fun, Opts])} + {ok, proc_lib:spawn_link(?MODULE, init, [Port, Module, Opts])} end. -init(Port, Module, Fun, Opts) -> +init(Port, Module, Opts) -> {ok, ListenSocket} = gen_tcp:listen(Port, [binary, {packet, 0}, {active, false}, {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 {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), - accept(ListenSocket, Module, Fun, Opts) + accept(ListenSocket, Module, Opts) end. -init_ssl(Port, Module, Fun, Opts, SSLOpts) -> +init_ssl(Port, Module, Opts, SSLOpts) -> {ok, ListenSocket} = ssl:listen(Port, [binary, {packet, 0}, {active, false}, @@ -70,13 +70,13 @@ init_ssl(Port, Module, Fun, Opts, SSLOpts) -> {backlog, 0}, {cachetimout, 0} | 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 {ok, Socket} -> - apply(Module, Fun, [{ssl, Socket}, Opts]), - accept_ssl(ListenSocket, Module, Fun, Opts) + apply(Module, start_link, [{ssl, Socket}, Opts]), + accept_ssl(ListenSocket, Module, Opts) end. diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index 0490c8e5..5f2a388e 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -168,7 +168,7 @@ do_route(From, To, Packet) -> ok; {atomic, new} -> ?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:write(#local_s2s{fromto = FromTo, pid = Pid}) diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 345fafae..0cc200f5 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -13,7 +13,7 @@ -behaviour(gen_fsm). %% 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 -export([init/1, @@ -63,8 +63,8 @@ %%%---------------------------------------------------------------------- %%% API %%%---------------------------------------------------------------------- -start(SockData, Opts) -> - gen_fsm:start(ejabberd_s2s_in, [SockData], ?FSMOPTS). +start_link(SockData, Opts) -> + gen_fsm:start_link(ejabberd_s2s_in, [SockData], ?FSMOPTS). %%%---------------------------------------------------------------------- %%% Callback functions from gen_fsm @@ -134,8 +134,8 @@ wait_for_key({xmlstreamelement, El}, StateData) -> ?INFO_MSG("GET KEY: ~p", [{To, From, Id, Key}]), case lists:member(To, ejabberd_router:dirty_get_all_domains()) of true -> - ejabberd_s2s_out:start(To, From, - {verify, self(), Key}), + ejabberd_s2s_out:start_link(To, From, + {verify, self(), Key}), {next_state, wait_for_verification, StateData#state{myname = To, diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 9754cafb..6efa7782 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -13,7 +13,7 @@ -behaviour(gen_fsm). %% External exports --export([start/3, send_text/2, send_element/2]). +-export([start_link/3, send_text/2, send_element/2]). %% gen_fsm callbacks -export([init/1, @@ -65,8 +65,9 @@ %%%---------------------------------------------------------------------- %%% API %%%---------------------------------------------------------------------- -start(From, Host, Type) -> - {ok, Pid} = gen_fsm:start(ejabberd_s2s_out, [From, Host, Type], ?FSMOPTS), +start_link(From, Host, Type) -> + {ok, Pid} = gen_fsm:start_link(ejabberd_s2s_out, [From, Host, Type], + ?FSMOPTS), Pid. %%%---------------------------------------------------------------------- @@ -212,13 +213,7 @@ wait_for_validation({xmlstreamelement, El}, StateData) -> _ -> gen_fsm:send_event(Pid, invalid) end, - case StateData#state.verify of - false -> - {stop, normal, StateData}; - _ -> - {next_state, wait_for_validation, - StateData#state{verify = false}, ?S2STIMEOUT} - end + {stop, normal, StateData} end; _ -> {next_state, wait_for_validation, StateData, ?S2STIMEOUT} diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl index bcd633d7..87c4245b 100644 --- a/src/ejabberd_service.erl +++ b/src/ejabberd_service.erl @@ -13,7 +13,7 @@ -behaviour(gen_fsm). %% 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 -export([init/1, @@ -69,8 +69,8 @@ %%%---------------------------------------------------------------------- %%% API %%%---------------------------------------------------------------------- -start(SockData, Opts) -> - gen_fsm:start(ejabberd_service, [SockData, Opts], ?FSMOPTS). +start_link(SockData, Opts) -> + gen_fsm:start_link(ejabberd_service, [SockData, Opts], ?FSMOPTS). %%%---------------------------------------------------------------------- %%% Callback functions from gen_fsm |