mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-04 16:40:36 +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:
parent
379b0d9e54
commit
6dc78ef0b5
11
ChangeLog
11
ChangeLog
@ -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>
|
||||
|
||||
* src/ejabberd_c2s.erl: Init shaper with a default value first
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
%% RFC 1928 replies
|
||||
-define(SUCCESS, 0).
|
||||
-define(ERR_GENERAL_FAILURE, 0).
|
||||
-define(ERR_GENERAL_FAILURE, 1).
|
||||
-define(ERR_NOT_ALLOWED, 2).
|
||||
-define(ERR_NETWORK_UNREACHABLE, 3).
|
||||
-define(ERR_HOST_UNREACHABLE, 4).
|
||||
|
@ -55,6 +55,7 @@ start_link(Host, Opts) ->
|
||||
init([Opts]) ->
|
||||
mnesia:create_table(bytestream, [{ram_copies, [node()]},
|
||||
{attributes, record_info(fields, bytestream)}]),
|
||||
mnesia:add_table_copy(bytestream, node(), ram_copies),
|
||||
MaxConnections = gen_mod:get_opt(max_connections, Opts, infinity),
|
||||
{ok, #state{max_connections=MaxConnections}}.
|
||||
|
||||
|
@ -51,8 +51,7 @@
|
||||
sha1, %% SHA1 key
|
||||
host, %% virtual host
|
||||
auth_type, %% authentication type: anonymous or plain
|
||||
shaper, %% Shaper name
|
||||
active = false %% Activity flag
|
||||
shaper %% Shaper name
|
||||
}).
|
||||
|
||||
%% Unused callbacks
|
||||
@ -83,9 +82,9 @@ init([Socket, Host, Opts]) ->
|
||||
shaper = Shaper,
|
||||
timer = TRef}}.
|
||||
|
||||
terminate(_Reason, _StateName, #state{sha1=SHA1,active=Flag}) ->
|
||||
terminate(_Reason, StateName, #state{sha1=SHA1}) ->
|
||||
catch mod_proxy65_sm:unregister_stream(SHA1),
|
||||
if Flag==true ->
|
||||
if StateName == stream_established ->
|
||||
?INFO_MSG("Bytestream terminated", []);
|
||||
true ->
|
||||
ok
|
||||
@ -199,7 +198,7 @@ handle_info({activate, PeerPid, PeerSocket, IJid, TJid},
|
||||
Host = StateData#state.host,
|
||||
MaxRate = find_maxrate(Shaper, IJid, TJid, Host),
|
||||
spawn_link(?MODULE, relay, [MySocket, PeerSocket, MaxRate]),
|
||||
{next_state, stream_established, StateData#state{active=true}};
|
||||
{next_state, stream_established, StateData};
|
||||
|
||||
%% Socket closed
|
||||
handle_info({tcp_closed, _Socket}, _StateName, StateData) ->
|
||||
|
Loading…
Reference in New Issue
Block a user