25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

*** empty log message ***

SVN Revision: 59
This commit is contained in:
Alexey Shchepin 2003-02-05 20:28:49 +00:00
parent 79f496e0c4
commit 7f0e4e195e
4 changed files with 30 additions and 11 deletions

View File

@ -102,7 +102,14 @@ make
<H3>2.4&nbsp;&nbsp; Starting</H3><!--SEC END --> <H3>2.4&nbsp;&nbsp; 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 erl -name ejabberd -s ejabberd
</PRE>TBD<BR> </PRE>TBD<BR>
<BR> <BR>

View File

@ -128,6 +128,14 @@ TBD
\subsection{Starting} \subsection{Starting}
\label{sec: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} \begin{verbatim}
erl -name ejabberd -s ejabberd erl -name ejabberd -s ejabberd
\end{verbatim} \end{verbatim}

View File

@ -13,8 +13,8 @@
-behaviour(gen_fsm). -behaviour(gen_fsm).
%% External exports %% External exports
-export([start/1, -export([start_link/1,
start/2, start_link/2,
import_file/1, import_file/1,
import_dir/1]). import_dir/1]).
@ -31,7 +31,7 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("namespaces.hrl"). -include("namespaces.hrl").
-record(state, {socket, -record(state, {socket, pid,
user = "", server = ?MYNAME, resource = "" user = "", server = ?MYNAME, resource = ""
}). }).
@ -47,12 +47,12 @@
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
%%% API %%% API
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
start(File) -> start_link(File) ->
User = filename:rootname(filename:basename(File)), User = filename:rootname(filename:basename(File)),
start(File, User). start_link(File, User).
start(File, User) -> start_link(File, User) ->
gen_fsm:start(?MODULE, [File, User], ?FSMOPTS). gen_fsm:start_link(?MODULE, [File, User, self()], ?FSMOPTS).
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
%%% Callback functions from gen_fsm %%% Callback functions from gen_fsm
@ -65,11 +65,11 @@ start(File, User) ->
%% ignore | %% ignore |
%% {stop, StopReason} %% {stop, StopReason}
%%---------------------------------------------------------------------- %%----------------------------------------------------------------------
init([File, User]) -> init([File, User, Pid]) ->
XMLStreamPid = xml_stream:start(self()), XMLStreamPid = xml_stream:start(self()),
{ok, Text} = file:read_file(File), {ok, Text} = file:read_file(File),
xml_stream:send_text(XMLStreamPid, Text), 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 %% Func: StateName/2
@ -191,6 +191,7 @@ handle_info(_, StateName, StateData) ->
%% Returns: any %% Returns: any
%%---------------------------------------------------------------------- %%----------------------------------------------------------------------
terminate(Reason, StateName, StateData) -> terminate(Reason, StateName, StateData) ->
StateData#state.pid ! {jd2ejd, exited},
ok. ok.
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
@ -216,7 +217,8 @@ process_offline(To, {xmlelement, _, _, Els}) ->
import_file(File) -> import_file(File) ->
start(File). start_link(File),
receive M -> M end.
import_dir(Dir) -> import_dir(Dir) ->
{ok, Files} = file:list_dir(Dir), {ok, Files} = file:list_dir(Dir),

View File

@ -85,6 +85,8 @@ check_event(From, To, Packet) ->
find_x_event([]) -> find_x_event([]) ->
false; false;
find_x_event([{xmlcdata, _} | Els]) ->
find_x_event(Els);
find_x_event([El | Els]) -> find_x_event([El | Els]) ->
case xml:get_tag_attr_s("xmlns", El) of case xml:get_tag_attr_s("xmlns", El) of
?NS_EVENT -> ?NS_EVENT ->