mirror of
https://github.com/processone/ejabberd.git
synced 2024-10-09 15:06:54 +02:00
*** empty log message ***
SVN Revision: 59
This commit is contained in:
parent
79f496e0c4
commit
7f0e4e195e
@ -102,7 +102,14 @@ make
|
||||
|
||||
<H3>2.4 Starting</H3><!--SEC END -->
|
||||
|
||||
<A NAME="sec:starting"></A><PRE>
|
||||
<A NAME="sec:starting"></A>... To use more then 1024 connections, you need to set environment
|
||||
variable <TT>ERL_MAX_PORTS</TT>:
|
||||
<PRE>
|
||||
export ERL_MAX_PORTS=32000
|
||||
</PRE>Note that with this value <TT>ejabberd</TT> will use more memory (approximately 6MB
|
||||
more)...<BR>
|
||||
<BR>
|
||||
<PRE>
|
||||
erl -name ejabberd -s ejabberd
|
||||
</PRE>TBD<BR>
|
||||
<BR>
|
||||
|
@ -128,6 +128,14 @@ TBD
|
||||
\subsection{Starting}
|
||||
\label{sec:starting}
|
||||
|
||||
\ldots{} To use more then 1024 connections, you need to set environment
|
||||
variable \texttt{ERL\_MAX\_PORTS}:
|
||||
\begin{verbatim}
|
||||
export ERL_MAX_PORTS=32000
|
||||
\end{verbatim}
|
||||
Note that with this value \ejabberd{} will use more memory (approximately 6MB
|
||||
more)\ldots{}
|
||||
|
||||
\begin{verbatim}
|
||||
erl -name ejabberd -s ejabberd
|
||||
\end{verbatim}
|
||||
|
@ -13,8 +13,8 @@
|
||||
-behaviour(gen_fsm).
|
||||
|
||||
%% External exports
|
||||
-export([start/1,
|
||||
start/2,
|
||||
-export([start_link/1,
|
||||
start_link/2,
|
||||
import_file/1,
|
||||
import_dir/1]).
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
-include("ejabberd.hrl").
|
||||
-include("namespaces.hrl").
|
||||
|
||||
-record(state, {socket,
|
||||
-record(state, {socket, pid,
|
||||
user = "", server = ?MYNAME, resource = ""
|
||||
}).
|
||||
|
||||
@ -47,12 +47,12 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% API
|
||||
%%%----------------------------------------------------------------------
|
||||
start(File) ->
|
||||
start_link(File) ->
|
||||
User = filename:rootname(filename:basename(File)),
|
||||
start(File, User).
|
||||
start_link(File, User).
|
||||
|
||||
start(File, User) ->
|
||||
gen_fsm:start(?MODULE, [File, User], ?FSMOPTS).
|
||||
start_link(File, User) ->
|
||||
gen_fsm:start_link(?MODULE, [File, User, self()], ?FSMOPTS).
|
||||
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% Callback functions from gen_fsm
|
||||
@ -65,11 +65,11 @@ start(File, User) ->
|
||||
%% ignore |
|
||||
%% {stop, StopReason}
|
||||
%%----------------------------------------------------------------------
|
||||
init([File, User]) ->
|
||||
init([File, User, Pid]) ->
|
||||
XMLStreamPid = xml_stream:start(self()),
|
||||
{ok, Text} = file:read_file(File),
|
||||
xml_stream:send_text(XMLStreamPid, Text),
|
||||
{ok, wait_for_xdb, #state{user = User}}.
|
||||
{ok, wait_for_xdb, #state{user = User, pid = Pid}}.
|
||||
|
||||
%%----------------------------------------------------------------------
|
||||
%% Func: StateName/2
|
||||
@ -191,6 +191,7 @@ handle_info(_, StateName, StateData) ->
|
||||
%% Returns: any
|
||||
%%----------------------------------------------------------------------
|
||||
terminate(Reason, StateName, StateData) ->
|
||||
StateData#state.pid ! {jd2ejd, exited},
|
||||
ok.
|
||||
|
||||
%%%----------------------------------------------------------------------
|
||||
@ -216,7 +217,8 @@ process_offline(To, {xmlelement, _, _, Els}) ->
|
||||
|
||||
|
||||
import_file(File) ->
|
||||
start(File).
|
||||
start_link(File),
|
||||
receive M -> M end.
|
||||
|
||||
import_dir(Dir) ->
|
||||
{ok, Files} = file:list_dir(Dir),
|
||||
|
@ -85,6 +85,8 @@ check_event(From, To, Packet) ->
|
||||
|
||||
find_x_event([]) ->
|
||||
false;
|
||||
find_x_event([{xmlcdata, _} | Els]) ->
|
||||
find_x_event(Els);
|
||||
find_x_event([El | Els]) ->
|
||||
case xml:get_tag_attr_s("xmlns", El) of
|
||||
?NS_EVENT ->
|
||||
|
Loading…
Reference in New Issue
Block a user