]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_s2s_out.erl: Close connection after key
authorAlexey Shchepin <alexey@process-one.net>
Mon, 14 Jul 2003 18:06:03 +0000 (18:06 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Mon, 14 Jul 2003 18:06:03 +0000 (18:06 +0000)
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

ChangeLog
doc/guide.html
doc/guide.tex
src/ejabberd.cfg
src/ejabberd_c2s.erl
src/ejabberd_listener.erl
src/ejabberd_s2s.erl
src/ejabberd_s2s_in.erl
src/ejabberd_s2s_out.erl
src/ejabberd_service.erl

index cd0a81faa667fe4f7b7f29efaa2b9a57a05afaf1..802c3d3c9f215b46dd3e049e0a289b6476516f0f 100644 (file)
--- a/ChangeLog
+++ b/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>
 
        * doc/guide.tex: Updated (thanks to Sergei Golovan)
index ab393ed7c3403641b9402d9c71111ce3f767c978..241412549540fbfc8bc8ee243adc121c976b85d2 100644 (file)
@@ -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>&nbsp;&nbsp;Starting</H3><!--SEC END -->
index 0142437d4aaaa1bfa7d3d1a6a6a5a4d9a25195bf..0c0a6d0fec6d7c898406ccae9c0512b563bb6170 100644 (file)
@@ -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.
index 57dc4bc00129189d98fb655c378bfd1a5e92150a..8e82f27486bc7221b44271e8b5ac5b61cd5b1776 100644 (file)
 
 {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
index fb6bec2758f76a79a1fb874fe36e67a77b83af0d..b8ccc1efb4d50bb118d08e4adc0adb8317398ea1 100644 (file)
@@ -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
index ffa9cbb17aad6a0db8f946950d449b4eacbc9155..0498506007ff766f7c100e09eec1bcb2aae69f79 100644 (file)
@@ -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.
 
 
index 0490c8e506772761d40e495c794fb853d7246fb1..5f2a388ec8b51fe184afc6eed14ede6f58c82a2f 100644 (file)
@@ -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})
index 345fafae10ea0aeeac73baaced26c485dbfc1ccc..0cc200f58e6f919744a4ef8c932dbc53bc11a15c 100644 (file)
@@ -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,
index 9754cafb517fff11574d391cdff36ec07cf87fa5..6efa7782f340826b3da1316301054d0ea61f56eb 100644 (file)
@@ -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}
index bcd633d7eb63f85ef08416bd70306e6830d95ad3..87c4245becb3565d4d250a037f7b6c01bab5de5a 100644 (file)
@@ -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