25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-04 16:40:36 +01:00

* src/ejabberd_service.erl: Added shaper_rule option, changed

service connection log message

SVN Revision: 744
This commit is contained in:
Alexey Shchepin 2007-03-13 16:01:39 +00:00
parent a1d0e7d7cb
commit c917642b7f
3 changed files with 18 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2007-03-13 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_service.erl: Added shaper_rule option, changed
service connection log message
2007-03-13 Mickael Remond <mickael.remond@process-one.net>
* src/ejabberd_service.erl: Add extra info in the log about which
@ -10,17 +15,19 @@
* src/web/ejabberd_http.erl: Support for binaries in ejabberd HTTP
server (Thanks to Massimiliano Mirra) (EJAB-197).
* src/configure.ac: autoconf improvements (thanks to Tony Finch) (EJAB-204).
* src/configure.ac: autoconf improvements (thanks to Tony Finch)
(EJAB-204).
* src/aclocal.m4: Likewise.
* src/odbc/ejabberd_odbc.erl: ejabberd admin can now choose the
relational database port to user from ejabberd configuration
file (EJAB-195).
relational database port to user from ejabberd configuration file
(EJAB-195).
* src/doc/guide.tex: Likewise.
2007-03-02 Mickael Remond <mickael.remond@process-one.net>
* src/mod_muc/mod_muc_log.erl: Fix wrong return on check access log.
* src/mod_muc/mod_muc_log.erl: Fix wrong return on check access
log.
2007-03-01 Alexey Shchepin <alexey@sevcom.net>

View File

@ -131,7 +131,7 @@
{max_stanza_size, 131072}
]},
{5280, ejabberd_http, [http_poll, web_admin]},
{8888, ejabberd_service, [{access, all},
{8888, ejabberd_service, [{access, all}, {shaper_rule, fast},
{hosts, ["icq.localhost", "sms.localhost"],
[{password, "secret"}]}]}
]}.

View File

@ -35,7 +35,6 @@
-record(state, {socket, sockmod, streamid,
hosts, password, access}).
-record(socket_state, {sockmod, socket, receiver}).
%-define(DBGFSM, true).
@ -95,12 +94,7 @@ socket_type() ->
%% {stop, StopReason}
%%----------------------------------------------------------------------
init([{SockMod, Socket}, Opts]) ->
?INFO_MSG("External service connected on receiver ~p,~n~p:~n~p~n",
[Socket#socket_state.receiver,
Socket#socket_state.socket,
{erlang:port_info(Socket#socket_state.socket),
inet:sockname(Socket#socket_state.socket),
inet:peername(Socket#socket_state.socket)}]),
?INFO_MSG("(~w) External service connected", [Socket]),
Access = case lists:keysearch(access, 1, Opts) of
{value, {_, A}} -> A;
_ -> all
@ -130,6 +124,11 @@ init([{SockMod, Socket}, Opts]) ->
false
end
end,
Shaper = case lists:keysearch(shaper_rule, 1, Opts) of
{value, {_, S}} -> S;
_ -> none
end,
SockMod:change_shaper(Socket, Shaper),
{ok, wait_for_stream, #state{socket = Socket,
sockmod = SockMod,
streamid = new_id(),