diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-03-10 15:12:43 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-03-10 15:12:43 +0300 |
commit | 02064ae12afe9ebbe92196575b427436398fd680 (patch) | |
tree | e9262548102b4096020a9c50b7c230856b6cc7c8 /src/mod_irc_connection.erl | |
parent | Report more TLS errors (diff) |
Add support for file-based queues
It's now possible to use files as internal packet queues.
The following options are introduced:
* queue_type: the option can be set to `ram` (default) or `file`.
The option can be set per virtual host.
* queue_dir: path to the directory where queues will be allocated.
The default is 'queue' directory inside Mnesia directory.
This is a global option and cannot be set per virtual host.
Diffstat (limited to 'src/mod_irc_connection.erl')
-rw-r--r-- | src/mod_irc_connection.erl | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/mod_irc_connection.erl b/src/mod_irc_connection.erl index 46ed8767..1e90c400 100644 --- a/src/mod_irc_connection.erl +++ b/src/mod_irc_connection.erl @@ -50,7 +50,6 @@ encoding = <<"">> :: binary(), port = 0 :: inet:port_number(), password = <<"">> :: binary(), - queue = queue:new() :: ?TQUEUE, user = #jid{} :: jid(), host = <<"">> :: binary(), server = <<"">> :: binary(), @@ -112,7 +111,7 @@ init([From, Host, Server, Username, Encoding, Port, Password, Ident, RemoteAddr, RealName, WebircPassword, Mod]) -> gen_fsm:send_event(self(), init), {ok, open_socket, - #state{queue = queue:new(), mod = Mod, + #state{mod = Mod, encoding = Encoding, port = Port, password = Password, user = From, nick = Username, host = Host, server = Server, ident = Ident, realname = RealName, @@ -695,15 +694,6 @@ send_text(#state{socket = Socket, encoding = Encoding}, CText = iconv:convert(<<"utf-8">>, Encoding, iolist_to_binary(Text)), gen_tcp:send(Socket, CText). -%send_queue(Socket, Q) -> -% case queue:out(Q) of -% {{value, El}, Q1} -> -% send_element(Socket, El), -% send_queue(Socket, Q1); -% {empty, Q1} -> -% ok -% end. - bounce_messages(Reason) -> receive {send_element, El} -> |