]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_proxy65/mod_proxy65_sm.erl: Cluster support (thanks to
authorAlexey Shchepin <alexey@process-one.net>
Thu, 22 Feb 2007 05:03:51 +0000 (05:03 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Thu, 22 Feb 2007 05:03:51 +0000 (05:03 +0000)
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

ChangeLog
src/mod_proxy65/mod_proxy65.hrl
src/mod_proxy65/mod_proxy65_sm.erl
src/mod_proxy65/mod_proxy65_stream.erl

index 73243654337042a01827038fdb8e86a484ebe065..370a95bb01f3f4ec1c20ecb4e1dd1d1e75085800 100644 (file)
--- a/ChangeLog
+++ b/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
index e01912383b0fda79704fc78c1535c4b4e7719fa8..eeab6804d8416ef5617ac80ca63793999543dd6d 100644 (file)
@@ -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).
index e799432f3c965f7727ce5ae2a19ede044827a00a..7ddfd2c898603323830b5bd73cbcda26c0909355 100644 (file)
@@ -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}}.
 
index 1f4a75dd8cb37dabea58e0a4c03efbae235bcffd..1a15033844dcea6d14acf7896881f82c9c7c3948 100644 (file)
@@ -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) ->