comparison mod_register_json/mod_register_json.lua @ 563:cd5581b58fdc

mod_register_json: switched module:get_option_boolean("use_libevent", nil) with require "core.configmanager".get("*", "core", "use_libevent") as the first possibly won't work (module is unloaded)
author Marco Cirillo <maranda@lightwitch.org>
date Tue, 17 Jan 2012 01:31:58 +0000
parents f2ec7149b005
children 39a612eb4431
comparison
equal deleted inserted replaced
562:b3f8435e661c 563:cd5581b58fdc
123 httpserver.new.http_servers[options.port].handlers[options.path or "register_account"] = nil 123 httpserver.new.http_servers[options.port].handlers[options.path or "register_account"] = nil
124 end 124 end
125 end 125 end
126 126
127 -- if there are no handlers left clean and close the socket, doesn't work with server_event 127 -- if there are no handlers left clean and close the socket, doesn't work with server_event
128 local event = module:get_option_boolean("use_libevent", nil) 128 local event = require "core.configmanager".get("*", "core", "use_libevent")
129 129
130 if not event then 130 if not event then
131 for _, options in ipairs(ports) do 131 for _, options in ipairs(ports) do
132 if options.port and not next(httpserver.new.http_servers[options.port].handlers) then 132 if options.port and not next(httpserver.new.http_servers[options.port].handlers) then
133 httpserver.new.http_servers[options.port] = nil 133 httpserver.new.http_servers[options.port] = nil