25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/mod_proxy65/mod_proxy65_sm.erl: Cluster support (thanks to

Evgeniy Khramtsov)

* src/mod_proxy65/mod_proxy65_stream.erl: Code cleanup (thanks to
Evgeniy Khramtsov)

* src/mod_proxy65/mod_proxy65.hrl: Fixed typo (thanks to Evgeniy
Khramtsov)

SVN Revision: 736
This commit is contained in:
Alexey Shchepin 2007-02-22 05:03:51 +00:00
parent 379b0d9e54
commit 6dc78ef0b5
4 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,14 @@
2007-02-22 Alexey Shchepin <alexey@sevcom.net>
* src/mod_proxy65/mod_proxy65_sm.erl: Cluster support (thanks to
Evgeniy Khramtsov)
* src/mod_proxy65/mod_proxy65_stream.erl: Code cleanup (thanks to
Evgeniy Khramtsov)
* src/mod_proxy65/mod_proxy65.hrl: Fixed typo (thanks to Evgeniy
Khramtsov)
2007-02-20 Alexey Shchepin <alexey@sevcom.net> 2007-02-20 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_c2s.erl: Init shaper with a default value first * src/ejabberd_c2s.erl: Init shaper with a default value first

View File

@ -27,7 +27,7 @@
%% RFC 1928 replies %% RFC 1928 replies
-define(SUCCESS, 0). -define(SUCCESS, 0).
-define(ERR_GENERAL_FAILURE, 0). -define(ERR_GENERAL_FAILURE, 1).
-define(ERR_NOT_ALLOWED, 2). -define(ERR_NOT_ALLOWED, 2).
-define(ERR_NETWORK_UNREACHABLE, 3). -define(ERR_NETWORK_UNREACHABLE, 3).
-define(ERR_HOST_UNREACHABLE, 4). -define(ERR_HOST_UNREACHABLE, 4).

View File

@ -55,6 +55,7 @@ start_link(Host, Opts) ->
init([Opts]) -> init([Opts]) ->
mnesia:create_table(bytestream, [{ram_copies, [node()]}, mnesia:create_table(bytestream, [{ram_copies, [node()]},
{attributes, record_info(fields, bytestream)}]), {attributes, record_info(fields, bytestream)}]),
mnesia:add_table_copy(bytestream, node(), ram_copies),
MaxConnections = gen_mod:get_opt(max_connections, Opts, infinity), MaxConnections = gen_mod:get_opt(max_connections, Opts, infinity),
{ok, #state{max_connections=MaxConnections}}. {ok, #state{max_connections=MaxConnections}}.

View File

@ -51,8 +51,7 @@
sha1, %% SHA1 key sha1, %% SHA1 key
host, %% virtual host host, %% virtual host
auth_type, %% authentication type: anonymous or plain auth_type, %% authentication type: anonymous or plain
shaper, %% Shaper name shaper %% Shaper name
active = false %% Activity flag
}). }).
%% Unused callbacks %% Unused callbacks
@ -83,9 +82,9 @@ init([Socket, Host, Opts]) ->
shaper = Shaper, shaper = Shaper,
timer = TRef}}. timer = TRef}}.
terminate(_Reason, _StateName, #state{sha1=SHA1,active=Flag}) -> terminate(_Reason, StateName, #state{sha1=SHA1}) ->
catch mod_proxy65_sm:unregister_stream(SHA1), catch mod_proxy65_sm:unregister_stream(SHA1),
if Flag==true -> if StateName == stream_established ->
?INFO_MSG("Bytestream terminated", []); ?INFO_MSG("Bytestream terminated", []);
true -> true ->
ok ok
@ -199,7 +198,7 @@ handle_info({activate, PeerPid, PeerSocket, IJid, TJid},
Host = StateData#state.host, Host = StateData#state.host,
MaxRate = find_maxrate(Shaper, IJid, TJid, Host), MaxRate = find_maxrate(Shaper, IJid, TJid, Host),
spawn_link(?MODULE, relay, [MySocket, PeerSocket, MaxRate]), spawn_link(?MODULE, relay, [MySocket, PeerSocket, MaxRate]),
{next_state, stream_established, StateData#state{active=true}}; {next_state, stream_established, StateData};
%% Socket closed %% Socket closed
handle_info({tcp_closed, _Socket}, _StateName, StateData) -> handle_info({tcp_closed, _Socket}, _StateName, StateData) ->