diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-11-29 07:16:45 +0500 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-11-29 07:16:45 +0500 |
commit | 36dd5eea337aebc8eb35b70e3fa3a93fc48f7a4b (patch) | |
tree | 946f436f1268fd970de15a3d8ef7d11a38fff245 /net/server.lua | |
parent | fa1aed4db29880ce158b889852899fa45c7dd88b (diff) | |
parent | 3e74495e5557a7d73385b3894a32e60be0356a46 (diff) | |
download | prosody-36dd5eea337aebc8eb35b70e3fa3a93fc48f7a4b.tar.gz prosody-36dd5eea337aebc8eb35b70e3fa3a93fc48f7a4b.zip |
Merge 0.9->trunk
Diffstat (limited to 'net/server.lua')
-rw-r--r-- | net/server.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/net/server.lua b/net/server.lua index 3fad4b45..d80b8a18 100644 --- a/net/server.lua +++ b/net/server.lua @@ -36,9 +36,41 @@ if use_luaevent then end end else + use_luaevent = false; server = require "net.server_select"; end +if prosody then + local config_get = require "core.configmanager".get; + local function load_config() + local settings = config_get("*", "core", "network_settings") or {}; + if use_luaevent then + local event_settings = { + ACCEPT_DELAY = settings.event_accept_retry_interval; + CLEAR_DELAY = settings.event_clear_interval; + CONNECT_TIMEOUT = settings.connect_timeout; + DEBUG = settings.debug; + HANDSHAKE_TIMEOUT = settings.ssl_handshake_timeout; + MAX_CONNECTIONS = settings.max_connections; + MAX_HANDSHAKE_ATTEMPTS = settings.max_ssl_handshake_roundtrips; + MAX_READ_LENGTH = settings.max_receive_buffer_size; + MAX_SEND_LENGTH = settings.max_send_buffer_size; + READ_TIMEOUT = settings.read_timeout; + WRITE_TIMEOUT = settings.send_timeout; + }; + + for k, v in pairs(event_settings) do + server.cfg[k] = v; + end + return true; + else + return server.changesettings(settings); + end + end + load_config(); + prosody.events.add_handler("config-reloaded", load_config); +end + -- require "net.server" shall now forever return this, -- ie. server_select or server_event as chosen above. return server; |