Software /
code /
prosody
Comparison
core/componentmanager.lua @ 3469:011566d72331
componentmanager: Relocate disallow_s2s to its correct position (thanks darkhoptipomatus)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 23:27:58 +0100 |
parent | 3462:cf72ef3c9009 |
child | 3540:bc139431830b |
comparison
equal
deleted
inserted
replaced
3468:d50e2c937717 | 3469:011566d72331 |
---|---|
40 | 40 |
41 for host, host_config in pairs(defined_hosts) do | 41 for host, host_config in pairs(defined_hosts) do |
42 if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then | 42 if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then |
43 hosts[host] = create_component(host); | 43 hosts[host] = create_component(host); |
44 hosts[host].connected = false; | 44 hosts[host].connected = false; |
45 disallow_s2s = configmanager.get(host, "core", "disallow_s2s"); | |
46 components[host] = default_component_handler; | 45 components[host] = default_component_handler; |
47 local ok, err = modulemanager.load(host, host_config.core.component_module); | 46 local ok, err = modulemanager.load(host, host_config.core.component_module); |
48 if not ok then | 47 if not ok then |
49 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); | 48 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); |
50 else | 49 else |
93 ssl_ctx_in = certmanager.create_context(host, "server"); | 92 ssl_ctx_in = certmanager.create_context(host, "server"); |
94 end | 93 end |
95 end | 94 end |
96 return { type = "component", host = host, connected = true, s2sout = {}, | 95 return { type = "component", host = host, connected = true, s2sout = {}, |
97 ssl_ctx = ssl_ctx, ssl_ctx_in = ssl_ctx_in, events = events or events_new(), | 96 ssl_ctx = ssl_ctx, ssl_ctx_in = ssl_ctx_in, events = events or events_new(), |
98 dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen() }; | 97 dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen(), |
98 disallow_s2s = configmanager.get(host, "core", "disallow_s2s"); }; | |
99 end | 99 end |
100 | 100 |
101 function register_component(host, component, session) | 101 function register_component(host, component, session) |
102 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then | 102 if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then |
103 local old_events = hosts[host] and hosts[host].events; | 103 local old_events = hosts[host] and hosts[host].events; |