liquid_feedback_frontend

annotate app/main/_prefork/10_init.lua @ 1202:30b3bf5db1bb

Fixed listening to non-local IPv4 interfaces
author bsw
date Sun Jul 12 20:46:57 2015 +0200 (2015-07-12)
parents 6b1f01c31092
children a38df55525d6
rev   line source
jbe@1167 1 if config.fork == nil then
bsw@1158 2 config.fork = {}
bsw@1158 3 end
bsw@1158 4
jbe@1167 5 if config.fork.pre == nil then
jbe@1167 6 config.fork.pre = 2
bsw@1158 7 end
bsw@1158 8
jbe@1167 9 if config.fork.min == nil then
jbe@1167 10 config.fork.min = 4
jbe@1167 11 end
jbe@1167 12
jbe@1167 13 if config.fork.max == nil then
bsw@1169 14 config.fork.max = 128
bsw@1158 15 end
bsw@1158 16
jbe@1167 17 if config.fork.delay == nil then
jbe@1167 18 config.fork.delay = 0.125
jbe@1167 19 end
jbe@1167 20
jbe@1167 21 if config.fork.error_delay == nil then
jbe@1167 22 config.fork.error_delay = 2
bsw@1158 23 end
bsw@1158 24
jbe@1167 25 if config.fork.exit_delay == nil then
jbe@1167 26 config.fork.exit_delay = 2
jbe@1167 27 end
jbe@1167 28
jbe@1167 29 if config.fork.idle_timeout == nil then
jbe@1167 30 config.fork.idle_timeout = 900
jbe@1167 31 end
jbe@1167 32
jbe@1167 33 if config.port == nil then
bsw@1158 34 config.port = 8080
bsw@1158 35 end
bsw@1158 36
bsw@1158 37 if config.localhost == nil then
bsw@1158 38 config.localhost = true
bsw@1158 39 end
bsw@1158 40
jbe@1167 41 local listen_options = {
jbe@1167 42 pre_fork = config.fork.pre,
jbe@1167 43 min_fork = config.fork.min,
jbe@1167 44 max_fork = config.fork.max,
jbe@1167 45 fork_delay = config.fork.delay,
jbe@1167 46 fork_error_delay = config.fork.error_delay,
jbe@1167 47 exit_delay = config.fork.exit_delay,
jbe@1167 48 idle_timeout = config.fork.idle_timeout,
bsw@1169 49 memory_limit = config.fork.memory_limit,
jbe@1167 50 min_requests_per_fork = config.fork.min_requests,
jbe@1167 51 max_requests_per_fork = config.fork.max_requests,
jbe@1167 52 http_options = config.http_options
jbe@1167 53 }
jbe@1167 54
jbe@1167 55 if config.ipv6 then
bsw@1199 56 local host = config.localhost and "::1" or "::"
bsw@1199 57 listen_options[#listen_options+1] = { proto = "tcp", host = host, port = config.port }
jbe@1167 58 end
jbe@1167 59 if config.ipv6 ~= "only" then
bsw@1202 60 local host = config.localhost and "127.0.0.1" or "0.0.0.0"
bsw@1199 61 listen_options[#listen_options+1] = { proto = "tcp", host = host, port = config.port }
jbe@1167 62 end
jbe@1167 63
jbe@1167 64 listen(listen_options)
jbe@1167 65
bsw@1158 66 listen{
jbe@1167 67 {
jbe@1167 68 proto = "interval",
jbe@1167 69 name = "send_pending_notifications",
jbe@1167 70 delay = 5,
jbe@1167 71 handler = function()
jbe@1167 72 Event:send_pending_notifications()
jbe@1167 73 end
jbe@1167 74 },
jbe@1167 75 min_fork = 1,
jbe@1167 76 max_fork = 1
bsw@1158 77 }
bsw@1158 78
bsw@1158 79 execute.inner()
bsw@1158 80

Impressum / About Us